'PublishAsync' missing in RabbitMq package

时间:2019-05-31 11:38:43

标签: asp.net-core rabbitmq

I have the following code:

public async Task<IActionResult> Post([FromBody]CreateActivity command)
        {
            command.Id = Guid.NewGuid();
            command.CreatedAt = DateTime.UtcNow;

            await _busClient.PublishAsync(command);

            return Accepted($"activities/{command.Id}");

        }

It seems like 'PublishAsync' method is missing in RabbitMq. This is my .csproj file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.0" />
    <PackageReference Include="RawRabbit" Version="2.0.0-beta8" />
    <PackageReference Include="RawRabbit.DependencyInjection.ServiceCollection" Version="2.0.0-beta8" />
    <PackageReference Include="RawRabbit.Operations.Subscribe" Version="2.0.0-beta8" />
  </ItemGroup>

</Project>

It is the same with all other stable versions.

enter image description here

1 个答案:

答案 0 :(得分:2)

the source code看,似乎PublishAsync方法在RawRabbit.Operations.Publish NuGet包中定义为扩展方法:

  

使用PublishAsync丰富BusClient,用于执行BasicPublish