-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from cnblogs/add-test-case
test: add a test case for '/dapr/subscribe'
- Loading branch information
Showing
11 changed files
with
398 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ure.Ddd.Cqrs.DependencyInjection.EventBus.Dapr/DaprEventBusServiceCollectionExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Cnblogs.Architecture.Ddd.EventBus.Abstractions; | ||
using Cnblogs.Architecture.Ddd.EventBus.Dapr; | ||
using Dapr.Client; | ||
|
||
namespace Microsoft.Extensions.DependencyInjection; | ||
|
||
/// <summary> | ||
/// IServiceCollection extensions for DaprEventBus | ||
/// </summary> | ||
public static class DaprEventBusServiceCollectionExtensions | ||
{ | ||
/// <summary> | ||
/// Register <see cref="DaprClient"/> and <see cref="IEventBus"/>. | ||
/// </summary> | ||
/// <param name="services"><see cref="IServiceCollection"/></param> | ||
/// <param name="appName">The app name used when publishing integration events.</param> | ||
/// <returns></returns> | ||
public static IServiceCollection AddDaprEventBus(this IServiceCollection services, string appName) | ||
{ | ||
services.Configure<DaprOptions>(o => o.AppName = appName); | ||
services.AddControllers().AddDapr(); | ||
services.AddScoped<IEventBus, DaprEventBus>(); | ||
return services; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.