Example #1
0
 public static ProviderGroupServiceBuilder <TKey, ISilo> AddDummySilo <TKey>(this ProviderGroupServiceBuilder <TKey, ISilo> builder, TKey key)
     where TKey : IComparable <TKey>
 {
     if (builder == null)
     {
         throw new ArgumentNullException(nameof(builder));
     }
     builder.Services.AddSingletonIfNotFound <IRuntime, DummyRuntime>()
     .AddSingletonIfNotFound <IMembershipOracle, DummyMembershipOracle>()
     .AddSingletonIfNotFound <IMessageCenter, DummyMessageCenter>()
     .AddSingletonIfNotFound <IReminderService, DummyReminderService>();
     builder.Add <DummySilo>(key);
     return(builder);
 }
Example #2
0
 public static ProviderGroupServiceBuilder <TKey, IStorageProvider> AddAzureStorageProvider <TKey>(this ProviderGroupServiceBuilder <TKey, IStorageProvider> builder, TKey key, string connectionString)
     where TKey : IComparable <TKey>
 {
     if (builder == null)
     {
         throw new ArgumentNullException(nameof(builder));
     }
     if (string.IsNullOrWhiteSpace(connectionString))
     {
         throw new ArgumentNullException(nameof(connectionString));
     }
     builder.Add <AzureStorageProvider>(key, (provider) => provider.Configure(connectionString));
     return(builder);
 }