Esempio n. 1
0
        public static void Initialize(IApplicationBuilder app)
        {
            context = app.ApplicationServices.GetRequiredService <WebStoreContext>();

            context.Database.EnsureCreated();


            if (context.Categories.Any())
            {
                return; // Az adatbázist már inicializáltnak vesszük, ha létezik kategoria
            }

            SeedCategories();
            SeedProducts();
        }
Esempio n. 2
0
 public ShoppingCartService(WebStoreContext context, IHttpContextAccessor httpContext)
 {
     this.context      = context;
     this.httpContext  = httpContext.HttpContext;
     ShoppingCartItems = new List <ShoppingCartItem>();
 }
Esempio n. 3
0
 public StoreService(ShoppingCartService shoppingCartService, WebStoreContext context, UserManager <Customer> userManager)
 {
     this.shoppingCartService = shoppingCartService;
     this.context             = context;
     this.userManager         = userManager;
 }