Преглед изворни кода

Fix the exception that the consumer name is null.

master
Savorboard пре 3 година
родитељ
комит
27d4bb7cef
4 измењених фајлова са 41 додато и 61 уклоњено
  1. +0
    -25
      .dockerignore
  2. +2
    -2
      build/version.props
  3. +33
    -33
      src/DotNetCore.CAP/CAP.Attribute.cs
  4. +6
    -1
      src/DotNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs

+ 0
- 25
.dockerignore Прегледај датотеку

@@ -1,25 +0,0 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

+ 2
- 2
build/version.props Прегледај датотеку

@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<VersionMajor>5</VersionMajor>
<VersionMinor>1</VersionMinor>
<VersionPatch>4</VersionPatch>
<VersionMinor>2</VersionMinor>
<VersionPatch>0</VersionPatch>
<VersionQuality></VersionQuality>
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
</PropertyGroup>


+ 33
- 33
src/DotNetCore.CAP/CAP.Attribute.cs Прегледај датотеку

@@ -1,39 +1,39 @@
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using DotNetCore.CAP.Internal;
// ReSharper disable once CheckNamespace
namespace DotNetCore.CAP
{
public class CapSubscribeAttribute : TopicAttribute
// Copyright (c) .NET Core Community. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using DotNetCore.CAP.Internal;
// ReSharper disable once CheckNamespace
namespace DotNetCore.CAP
{
public class CapSubscribeAttribute : TopicAttribute
{
public CapSubscribeAttribute(string name, bool isPartial = false)
: base(name, isPartial)
public CapSubscribeAttribute(string name, bool isPartial = false)
: base(name, isPartial)
{
}
public override string ToString()
{
return Name;
}
}
[AttributeUsage(AttributeTargets.Parameter)]
public class FromCapAttribute : Attribute
{
}
public class CapHeader : ReadOnlyDictionary<string, string>
{
public CapHeader(IDictionary<string, string> dictionary) : base(dictionary)
{
}
}
public override string ToString()
{
return Name;
}
}
[AttributeUsage(AttributeTargets.Parameter)]
public class FromCapAttribute : Attribute
{
}
public class CapHeader : ReadOnlyDictionary<string, string>
{
public CapHeader(IDictionary<string, string> dictionary) : base(dictionary)
{
}
}
}

+ 6
- 1
src/DotNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs Прегледај датотеку

@@ -131,7 +131,7 @@ namespace DotNetCore.CAP.Internal
// Ignore partial attributes when no topic attribute is defined on class.
if (topicClassAttribute is null)
{
topicMethodAttributes = topicMethodAttributes.Where(x => !x.IsPartial);
topicMethodAttributes = topicMethodAttributes.Where(x => !x.IsPartial && x.Name != null);
}

if (!topicMethodAttributes.Any())
@@ -189,6 +189,11 @@ namespace DotNetCore.CAP.Internal

private ConsumerExecutorDescriptor MatchUsingName(string key, IReadOnlyList<ConsumerExecutorDescriptor> executeDescriptor)
{
if (key == null)
{
throw new ArgumentNullException(nameof(key));
}

return executeDescriptor.FirstOrDefault(x => x.TopicName.Equals(key, StringComparison.InvariantCultureIgnoreCase));
}



Loading…
Откажи
Сачувај