public static void SeedHostDb(BookingSystemDbContext 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 static BookingSystemDbContext GetInMemoryDbContext() { var options = new DbContextOptionsBuilder <BookingSystemDbContext>() .UseInMemoryDatabase(databaseName: "Inmemory_db") .ConfigureWarnings(x => x.Ignore(InMemoryEventId.TransactionIgnoredWarning)) .Options; var seedService = new SeedService(); var context = new BookingSystemDbContext(options, seedService); lock (_lock) { if (!context.Users.Any()) { context.Users.AddRange(seedService.Users.Select(x => x.Value)); context.Images.AddRange(seedService.Images.Select(x => x.Value)); context.Events.AddRange(seedService.Events.Select(x => x.Value)); context.ServiceTypes.AddRange(seedService.ServiceTypes.Select(x => x.Value)); context.Services.AddRange(seedService.Services.Select(x => x.Value)); context.SaveChanges(); } } return(context); }
public BookingSystemRepository(BookingSystemDbContext context) { _context = context; }
public HostRoleAndUserCreator(BookingSystemDbContext context) { _context = context; }
public DefaultLanguagesCreator(BookingSystemDbContext context) { _context = context; }
public EvenSchedulesController(BookingSystemDbContext context, UserManager <User> userManager, ILogger <EvenSchedulesController> logger) : base(context, userManager) { _logger = logger; }
public ImageService(BookingSystemDbContext context) { _ctx = context; }
public InitialHostDbBuilder(BookingSystemDbContext context) { _context = context; }
public TenantRoleAndUserBuilder(BookingSystemDbContext context, int tenantId) { _context = context; _tenantId = tenantId; }
public ServiceEventsController(BookingSystemDbContext context, UserManager <User> userManager, ILogger <ServiceEventsController> logger) : base(context, userManager) { _logger = logger; }
public ImageSeedService(BookingSystemDbContext context) => _context = context;
public DefaultTenantCreator(BookingSystemDbContext context) { _context = context; }
public BookingManagerService(BookingSystemDbContext context) { _context = context; }
public DefaultEditionsCreator(BookingSystemDbContext context) { _context = context; }
public DefaultSettingsCreator(BookingSystemDbContext context) { _context = context; }
public EventScheduleService(BookingSystemDbContext context) { _ctx = context; }
public BaseController(BookingSystemDbContext context, UserManager <User> userManager) { _context = context; _userManager = userManager; }
public DefaultTenantBuilder(BookingSystemDbContext context) { _context = context; }