public UserRepository(SampleAppDbContext context) { DbContext = context; DbContext.Database.EnsureDeleted(); DbContext.Database.EnsureCreated(); }
public static void SeedHostDb(SampleAppDbContext context) { context.SuppressAutoSetTenantId = true; //Host seed new InitialHostDbBuilder(context).Create(); //Default tenant seed (in host database). new DefaultTenantBuilder(context).Create(); new TenantRoleAndUserBuilder(context, 1).Create(); }
private static SqliteConnection CreateDatabaseAndGetConnection() { var connection = new SqliteConnection("Data Source=:memory:"); connection.Open(); var options = new DbContextOptionsBuilder <SampleAppDbContext>() .UseSqlite(connection) .Options; using (var context = new SampleAppDbContext(options)) { context.GetService <IRelationalDatabaseCreator>().CreateTables(); } return(connection); }
public DefaultEditionCreator(SampleAppDbContext context) { this.context = context; }
public TestOrganizationUnitsBuilder(SampleAppDbContext context, int tenantId) { _context = context; _tenantId = tenantId; }
public DefaultTenantBuilder(SampleAppDbContext context) { this.context = context; }
public DepartmentRepository(SampleAppDbContext sampleAppDbContext) { _sampleAppDbContext = sampleAppDbContext; }
public TenantRoleAndUserBuilder(SampleAppDbContext context, int tenantId) { _context = context; _tenantId = tenantId; }
public DefaultLanguagesCreator(SampleAppDbContext context) { _context = context; }
public TestRolesBuilder(SampleAppDbContext context, int tenantId) { this.context = context; this.tenantId = tenantId; }
public HostRoleAndUserCreator(SampleAppDbContext context) { _context = context; }
public TestDataBuilder(SampleAppDbContext context, int tenantId) { _context = context; _tenantId = tenantId; }
public InitialHostDbBuilder(SampleAppDbContext context) { _context = context; }
public EmployeeRepository(SampleAppDbContext sampleAppDbContext) { _sampleAppDbContext = sampleAppDbContext; }
public DefaultSettingsCreator(SampleAppDbContext context) { this.context = context; }