Procházet zdrojové kódy

Fix the exception that the consumer name is null.

master
Savorboard před 3 roky
rodič
revize
27d4bb7cef
4 změnil soubory, kde provedl 41 přidání a 61 odebrání
  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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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 Zobrazit soubor

@@ -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));
}



Načítá se…
Zrušit
Uložit