示例#1
0
        public UserRepository(SampleAppDbContext context)
        {
            DbContext = context;

            DbContext.Database.EnsureDeleted();
            DbContext.Database.EnsureCreated();
        }
示例#2
0
        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;
 }
示例#6
0
 public DefaultTenantBuilder(SampleAppDbContext context)
 {
     this.context = context;
 }
 public DepartmentRepository(SampleAppDbContext sampleAppDbContext)
 {
     _sampleAppDbContext = sampleAppDbContext;
 }
示例#8
0
 public TenantRoleAndUserBuilder(SampleAppDbContext context, int tenantId)
 {
     _context  = context;
     _tenantId = tenantId;
 }
示例#9
0
 public DefaultLanguagesCreator(SampleAppDbContext context)
 {
     _context = context;
 }
示例#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;
 }
示例#13
0
 public InitialHostDbBuilder(SampleAppDbContext context)
 {
     _context = context;
 }
示例#14
0
 public EmployeeRepository(SampleAppDbContext sampleAppDbContext)
 {
     _sampleAppDbContext = sampleAppDbContext;
 }
示例#15
0
 public DefaultSettingsCreator(SampleAppDbContext context)
 {
     this.context = context;
 }