Skip to content

Commit

Permalink
configure argument when adding InMemory transport can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell committed Dec 29, 2020
1 parent ec14e65 commit e1e5d07
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ public static class EventBusBuilderExtensions
/// <param name="builder"></param>
/// <param name="configure"></param>
/// <returns></returns>
public static EventBusBuilder AddInMemory(this EventBusBuilder builder, Action<InMemoryOptions> configure)
public static EventBusBuilder AddInMemory(this EventBusBuilder builder, Action<InMemoryOptions> configure = null)
{
if (builder == null) throw new ArgumentNullException(nameof(builder));
if (configure is null) throw new ArgumentNullException(nameof(configure));

var services = builder.Services;

// configure the options for Azure Service Bus
services.Configure(configure);
if (configure != null)
{
services.Configure(configure);
}

// register the event bus
services.AddSingleton<IEventBus, InMemoryEventBus>();
Expand Down

0 comments on commit e1e5d07

Please sign in to comment.