Beispiel #1
0
 public TenantedDbContext(DbContextOptions <TenantedDbContext> options,
                          IConfiguration config,
                          ITenantProvider tenantProvider)
     : base(options)
 {
     _tenant           = tenantProvider?.GetCurrentRequestTenant() ?? throw new ArgumentNullException(nameof(tenantProvider));
     _connectionString = config.GetTenantedConnectionString(_tenant.Id) ?? throw new ArgumentNullException("Unable to source template connection string from config.");
 }