Browse Source

Merge pull request #260 from colinin/4.3

upgrade cap to 5.0.2
pull/274/head
cKey 5 years ago
committed by GitHub
parent
commit
398a86ea42
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj
  2. 9
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPMessageExtensions.cs

4
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj

@ -3,7 +3,7 @@
<Import Project="..\..\..\common.props" /> <Import Project="..\..\..\common.props" />
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.1</TargetFramework>
<RootNamespace /> <RootNamespace />
<Description>Cap分布式事件总线</Description> <Description>Cap分布式事件总线</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
@ -11,7 +11,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DotNetCore.CAP" Version="3.1.2" /> <PackageReference Include="DotNetCore.CAP" Version="5.0.2" />
<PackageReference Include="Volo.Abp.BackgroundWorkers" Version="4.3.0" /> <PackageReference Include="Volo.Abp.BackgroundWorkers" Version="4.3.0" />
<PackageReference Include="Volo.Abp.EventBus" Version="4.3.0" /> <PackageReference Include="Volo.Abp.EventBus" Version="4.3.0" />
</ItemGroup> </ItemGroup>

9
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPMessageExtensions.cs

@ -16,16 +16,17 @@ namespace LINGYUN.Abp.EventBus.CAP
/// <returns></returns> /// <returns></returns>
public static bool TryGetTenantId( public static bool TryGetTenantId(
this Message message, this Message message,
out Guid tenantId) out Guid? tenantId)
{ {
if (message.Headers.TryGetValue(AbpCAPHeaders.TenantId, out string tenantStr)) if (message.Headers.TryGetValue(AbpCAPHeaders.TenantId, out string tenantStr))
{ {
if (Guid.TryParse(tenantStr, out tenantId)) if (Guid.TryParse(tenantStr, out Guid id))
{ {
tenantId = id;
return true; return true;
} }
} }
tenantId = null;
return false; return false;
} }
/// <summary> /// <summary>
@ -36,7 +37,7 @@ namespace LINGYUN.Abp.EventBus.CAP
public static Guid? GetTenantIdOrNull( public static Guid? GetTenantIdOrNull(
this Message message) this Message message)
{ {
if (message.TryGetTenantId(out Guid tenantId)) if (message.TryGetTenantId(out Guid? tenantId))
{ {
return tenantId; return tenantId;
} }

Loading…
Cancel
Save