public AccountsController(PizzaShopDbContext context, IMapper mapper) { this.context = context ?? throw new ArgumentNullException(); this.mapper = mapper ?? throw new ArgumentNullException(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { using (PizzaShopDbContext pizzaShopDbContext = app.ApplicationServices.CreateScope() .ServiceProvider.GetRequiredService <PizzaShopDbContext>()) { try { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); pizzaShopDbContext.Database.EnsureDeleted(); pizzaShopDbContext.Database.EnsureCreated(); pizzaShopDbContext.Add(new Customer { PhoneNumber = "1111111111", Password = "******", Name = "Surafel Assefa", Address = "White House", PaymentType = PaymentType.VisaCard, }); pizzaShopDbContext.SaveChanges(); } else { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); pizzaShopDbContext.Database.Migrate(); } } catch (PostgresException e) { throw e; } } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseSession(); app.UseEndpoints(endpoints => { endpoints.MapRazorPages(); }); }
public PizzaIngredientRepository(PizzaShopDbContext pizzaShopDbContext) : base(pizzaShopDbContext) { }
public OrderController(PizzaShopDbContext ctx) { context = ctx; }
public PizzaService(PizzaShopDbContext dbContext) { _dbContext = dbContext; }
public AccountRepository(PizzaShopDbContext pizzaShopDbContext) : base(pizzaShopDbContext) { }
public PizzaRepository(PizzaShopDbContext pizzaShopDbContext) : base(pizzaShopDbContext) { }
public BranchController(PizzaShopDbContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public ProductsController(PizzaShopDbContext context) { this.context = context ?? throw new ArgumentNullException(nameof(context)); }
public GenericRepository(PizzaShopDbContext pizzaShopDbContext) { _pizzaShopDbContext = pizzaShopDbContext; All = Table; }
public ProductController(PizzaShopDbContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public PizzaShopDbHandler(PizzaShopDbContext pizzaShopDbContext) { _pizzaShopDbContext = pizzaShopDbContext; }
public IngredientService(PizzaShopDbContext dbContext) { _dbContext = dbContext; }