diff --git a/src/Cap.Consistency/Extensions/BuilderExtensions.cs b/src/Cap.Consistency/Extensions/BuilderExtensions.cs
index 76fe38d..675bae3 100644
--- a/src/Cap.Consistency/Extensions/BuilderExtensions.cs
+++ b/src/Cap.Consistency/Extensions/BuilderExtensions.cs
@@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Builder
var context = new TopicRouteContext();
- router.RouteAsync(context).Wait();
+ router.RouteAsync(context);
return app;
}
diff --git a/src/Cap.Consistency/Extensions/ConsistencyOptions.cs b/src/Cap.Consistency/Extensions/ConsistencyOptions.cs
deleted file mode 100644
index 53e21c9..0000000
--- a/src/Cap.Consistency/Extensions/ConsistencyOptions.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using Cap.Consistency;
-
-namespace Microsoft.AspNetCore.Builder
-{
- ///
- /// Represents all the options you can use to configure the system.
- ///
- public class ConsistencyOptions
- {
- public string BrokerUrlList { get; set; } = "localhost:9092";
- }
-}
\ No newline at end of file
diff --git a/src/Cap.Consistency/Extensions/ServiceCollectionExtensions.cs b/src/Cap.Consistency/Extensions/ServiceCollectionExtensions.cs
index f4d1402..70712fd 100644
--- a/src/Cap.Consistency/Extensions/ServiceCollectionExtensions.cs
+++ b/src/Cap.Consistency/Extensions/ServiceCollectionExtensions.cs
@@ -19,7 +19,7 @@ namespace Microsoft.Extensions.DependencyInjection
/// An for application services.
public static ConsistencyBuilder AddConsistency(this IServiceCollection services)
where TMessage : ConsistencyMessage {
- return services.AddConsistency(setupAction: null);
+ return services.AddConsistency(x => new ConsistencyOptions());
}
///
@@ -34,9 +34,7 @@ namespace Microsoft.Extensions.DependencyInjection
services.TryAddScoped, ConsistencyMessageManager>();
- if (setupAction != null) {
- services.Configure(setupAction);
- }
+ services.Configure(setupAction);
return new ConsistencyBuilder(typeof(TMessage), services);
}