public async Task InvokeAsync( HttpContext context, UnravelTravelDbContext dbContext) { this.dbContext = dbContext; await this.SeedCountries(); await this.next(context); }
public async Task InvokeAsync( HttpContext context, UserManager <UnravelTravelUser> userManager, RoleManager <ApplicationRole> roleManager, UnravelTravelDbContext dbContext, IShoppingCartsService shoppingCartsService) { await SeedUserInRoles(userManager, shoppingCartsService); await this.next(context); }
public static void Seed(UnravelTravelDbContext dbContext, RoleManager <ApplicationRole> roleManager) { if (dbContext == null) { throw new ArgumentNullException(nameof(dbContext)); } if (roleManager == null) { throw new ArgumentNullException(nameof(roleManager)); } SeedRoles(roleManager); }
public static void Seed(UnravelTravelDbContext dbContext, IServiceProvider serviceProvider) { if (dbContext == null) { throw new ArgumentNullException(nameof(dbContext)); } if (serviceProvider == null) { throw new ArgumentNullException(nameof(serviceProvider)); } var roleManager = serviceProvider.GetRequiredService <RoleManager <ApplicationRole> >(); Seed(dbContext, roleManager); }
public EfDeletableEntityRepository(UnravelTravelDbContext context) : base(context) { }
public EfRepository(UnravelTravelDbContext context) { this.Context = context ?? throw new ArgumentNullException(nameof(context)); this.DbSet = this.Context.Set <TEntity>(); }