public static IServiceCollection AddConcurrency( this IServiceCollection serviceCollection, Action <StorageOptionsBuilder> callback) { if (serviceCollection == null) { throw new ArgumentNullException(nameof(serviceCollection)); } if (callback == null) { throw new ArgumentNullException(nameof(callback)); } var builder = new StorageOptionsBuilder(serviceCollection); callback(builder); serviceCollection.AddSingleton(builder.StorageOptions); serviceCollection.AddConcurrency(); return(serviceCollection); }