Exemple #1
0
        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;
 }
Exemple #8
0
 public TenantRoleAndUserBuilder(SampleAppDbContext context, int tenantId)
 {
     _context  = context;
     _tenantId = tenantId;
 }
Exemple #9
0
 public DefaultLanguagesCreator(SampleAppDbContext context)
 {
     _context = context;
 }
Exemple #10
0
 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;
 }
Exemple #13
0
 public InitialHostDbBuilder(SampleAppDbContext context)
 {
     _context = context;
 }
Exemple #14
0
 public EmployeeRepository(SampleAppDbContext sampleAppDbContext)
 {
     _sampleAppDbContext = sampleAppDbContext;
 }
 public DefaultSettingsCreator(SampleAppDbContext context)
 {
     this.context = context;
 }