public static void SeedHostDb(PsyDbContext 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(); }
public void Configure(IApplicationBuilder app) { using (IServiceScope serviceScope = app.ApplicationServices.GetService <IServiceScopeFactory>().CreateScope()) { PsyDbContext psyDbContext = serviceScope.ServiceProvider.GetRequiredService <PsyDbContext>(); psyDbContext.Database.Migrate(); } if (this.hostingEnvironment.IsProduction()) { app.UseHttpsRedirection(); } app .UseDefaultFiles() .UseStaticFiles() .UseAuthentication() .UseSignalR(routes => { routes.MapHub <ChatHub>("/chat"); }) .UseBotFramework() .UseMvcWithDefaultRoute(); }
public DefaultTenantBuilder(PsyDbContext context) { _context = context; }
public UserRepository(PsyDbContext dbContext) { this.dbContext = dbContext; }
public TenantRoleAndUserBuilder(PsyDbContext context, int tenantId) { _context = context; _tenantId = tenantId; }
public DefaultLanguagesCreator(PsyDbContext context) { _context = context; }
public HostRoleAndUserCreator(PsyDbContext context) { _context = context; }
public DefaultEditionCreator(PsyDbContext context) { _context = context; }
public InitialHostDbBuilder(PsyDbContext context) { _context = context; }
public DefaultSettingsCreator(PsyDbContext context) { _context = context; }