Example #1
0
 public static IServiceCollection Dummy <TDbContext>(this TenantDbContextIdentification <TDbContext> identification)
     where TDbContext : DbContext
 {
     return(identification._services.AddSingleton <IDbContextTenantStrategy <TDbContext>, DummyTenantDbContext <TDbContext> >());
 }
Example #2
0
 public static IServiceCollection DifferentConnectionForTenant <TDbContext>(this TenantDbContextIdentification <TDbContext> identification, string connectionStringName)
     where TDbContext : DbContext
 {
     return(identification._services.AddSingleton <IDbContextTenantStrategy <TDbContext> >(x => new DifferentConnectionTenantDbContext <TDbContext>(connectionStringName)));
 }
Example #3
0
 public static IServiceCollection AllowDifferentSchemaForTenant <TDbContext>(this TenantDbContextIdentification <TDbContext> identification)
     where TDbContext : DbContext
 {
     return(identification._services.AddSingleton <IDbContextTenantStrategy <TDbContext>, DifferentSchemaTenantDbContex <TDbContext> >());
 }