public Task <TContext> CreateDbContext() { var connectionString = _connectionStringProvider.GetForCustomer(); var optionsBuilder = new DbContextOptionsBuilder <TContext>(); optionsBuilder.UseSqlServer(connectionString); var ctx = (TContext)Activator.CreateInstance(typeof(TContext), optionsBuilder.Options); return(Task.FromResult(ctx)); }
public IDbConnection GetTenant() { var connectionString = _connectionStringProvider.GetForCustomer(); return(new SqlConnection(connectionString)); }