Beispiel #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, PizzaStoreContext context)
        {
            if (context.Database.GetPendingMigrations().Count<string>() > 0)
                context.Database.Migrate();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            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();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapBlazorHub();
                endpoints.MapFallbackToPage("/_Host");
            });
        }
Beispiel #2
0
 public StoreRepo(PizzaStoreContext dbContext)
 {
     _dbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
 }
Beispiel #3
0
 public NotificationsController(PizzaStoreContext context)
 {
     this.Context = context;
 }
 public OrdersController()
 {
     _db = new PizzaStoreContext();
 }
 public OrderServiceImpl(PizzaStoreContext db, ConnectionMultiplexer multiplexer)
 {
     this.db          = db;
     this.multiplexer = multiplexer;
 }
 public SpecialsController(PizzaStoreContext context)
 {
     this.Context = context;
 }
        public static void Initialize(PizzaStoreContext db)
        {
            var toppings = new Topping[]
            {
                new Topping()
                {
                    Name  = "Extra cheese",
                    Price = 2.50m,
                },
                new Topping()
                {
                    Name  = "American bacon",
                    Price = 2.99m,
                },
                new Topping()
                {
                    Name  = "British bacon",
                    Price = 2.99m,
                },
                new Topping()
                {
                    Name  = "Canadian bacon",
                    Price = 2.99m,
                },
                new Topping()
                {
                    Name  = "Tea and crumpets",
                    Price = 5.00m
                },
                new Topping()
                {
                    Name  = "Fresh-baked scones",
                    Price = 4.50m,
                },
                new Topping()
                {
                    Name  = "Bell peppers",
                    Price = 1.00m,
                },
                new Topping()
                {
                    Name  = "Onions",
                    Price = 1.00m,
                },
                new Topping()
                {
                    Name  = "Mushrooms",
                    Price = 1.00m,
                },
                new Topping()
                {
                    Name  = "Pepperoni",
                    Price = 1.00m,
                },
                new Topping()
                {
                    Name  = "Duck sausage",
                    Price = 3.20m,
                },
                new Topping()
                {
                    Name  = "Venison meatballs",
                    Price = 2.50m,
                },
                new Topping()
                {
                    Name  = "Served on a silver platter",
                    Price = 250.99m,
                },
                new Topping()
                {
                    Name  = "Lobster on top",
                    Price = 64.50m,
                },
                new Topping()
                {
                    Name  = "Sturgeon caviar",
                    Price = 101.75m,
                },
                new Topping()
                {
                    Name  = "Artichoke hearts",
                    Price = 3.40m,
                },
                new Topping()
                {
                    Name  = "Fresh tomatos",
                    Price = 1.50m,
                },
                new Topping()
                {
                    Name  = "Basil",
                    Price = 1.50m,
                },
                new Topping()
                {
                    Name  = "Steak (medium-rare)",
                    Price = 8.50m,
                },
                new Topping()
                {
                    Name  = "Blazing hot peppers",
                    Price = 4.20m,
                },
                new Topping()
                {
                    Name  = "Buffalo chicken",
                    Price = 5.00m,
                },
                new Topping()
                {
                    Name  = "Blue cheese",
                    Price = 2.50m,
                },
            };

            var specials = new PizzaSpecial[]
            {
                new PizzaSpecial()
                {
                    Name        = "Basic Cheese Pizza",
                    Description = "It's cheesy and delicious. Why wouldn't you want one?",
                    BasePrice   = 9.99m,
                    ImageUrl    = "img/pizzas/cheese.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 2,
                    Name        = "The Baconatorizor",
                    Description = "It has EVERY kind of bacon",
                    BasePrice   = 11.99m,
                    ImageUrl    = "img/pizzas/bacon.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 3,
                    Name        = "Classic pepperoni",
                    Description = "It's the pizza you grew up with, but Blazing hot!",
                    BasePrice   = 10.50m,
                    ImageUrl    = "img/pizzas/pepperoni.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 4,
                    Name        = "Buffalo chicken",
                    Description = "Spicy chicken, hot sauce and bleu cheese, guaranteed to warm you up",
                    BasePrice   = 12.75m,
                    ImageUrl    = "img/pizzas/meaty.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 5,
                    Name        = "Mushroom Lovers",
                    Description = "It has mushrooms. Isn't that obvious?",
                    BasePrice   = 11.00m,
                    ImageUrl    = "img/pizzas/mushroom.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 6,
                    Name        = "The Brit",
                    Description = "When in London...",
                    BasePrice   = 10.25m,
                    ImageUrl    = "img/pizzas/brit.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 7,
                    Name        = "Veggie Delight",
                    Description = "It's like salad, but on a pizza",
                    BasePrice   = 11.50m,
                    ImageUrl    = "img/pizzas/salad.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 8,
                    Name        = "Margherita",
                    Description = "Traditional Italian pizza with tomatoes and basil",
                    BasePrice   = 9.99m,
                    ImageUrl    = "img/pizzas/margherita.jpg",
                },
            };

            db.Toppings.AddRange(toppings);
            db.Specials.AddRange(specials);
            db.SaveChanges();
        }
Beispiel #8
0
 public static void Initialize(PizzaStoreContext db)
 {
     db.Toppings.AddRange(PizzaToppings);
     db.Specials.AddRange(PizzaSpecials);
     db.SaveChanges();
 }
 public SpecialEventCategoryService(PizzaStoreContext pizzaStoreContext)
 {
     Context = pizzaStoreContext;
 }
Beispiel #10
0
 public OrdersController(PizzaStoreContext context)
 {
     this.Context = context;
 }
Beispiel #11
0
        public static void Initialize(PizzaStoreContext db)
        {
            var toppings = new Topping[]
            {
                new Topping()
                {
                    Name  = "Допълнително сирене",
                    Price = 1.50m,
                },
                new Topping()
                {
                    Name  = "Американски бекон",
                    Price = 1.99m,
                },
                new Topping()
                {
                    Name  = "Британски бекон",
                    Price = 1.99m,
                },
                new Topping()
                {
                    Name  = "Канадски бекон",
                    Price = 1.99m,
                },
                new Topping()
                {
                    Name  = "чай с бисквити",
                    Price = 3.00m
                },
                new Topping()
                {
                    Name  = "Прясно изпечени котлети",
                    Price = 3.50m,
                },
                new Topping()
                {
                    Name  = "Камби",
                    Price = 1.00m,
                },
                new Topping()
                {
                    Name  = "Лук",
                    Price = 1.00m,
                },
                new Topping()
                {
                    Name  = "Гъби",
                    Price = 1.00m,
                },
                new Topping()
                {
                    Name  = "Пеперони",
                    Price = 1.00m,
                },
                new Topping()
                {
                    Name  = "Патешко месо",
                    Price = 2.20m,
                },
                new Topping()
                {
                    Name  = "Кюфтенца",
                    Price = 1.50m,
                },
                new Topping()
                {
                    Name  = "Омар",
                    Price = 44.50m,
                },
                new Topping()
                {
                    Name  = "Хайвер",
                    Price = 80.75m,
                },
                new Topping()
                {
                    Name  = "Артишок",
                    Price = 2.40m,
                },
                new Topping()
                {
                    Name  = "Пресни домати",
                    Price = 0.50m,
                },
                new Topping()
                {
                    Name  = "Босилек",
                    Price = 0.50m,
                },
                new Topping()
                {
                    Name  = "Пържола (medium-rare)",
                    Price = 8.50m,
                },
                new Topping()
                {
                    Name  = "Люти чушки",
                    Price = 2.20m,
                },
                new Topping()
                {
                    Name  = "Buffalo chicken",
                    Price = 5.00m,
                },
                new Topping()
                {
                    Name  = "Синьо сирене",
                    Price = 1.50m,
                },
            };

            var specials = new PizzaSpecial[]
            {
                new PizzaSpecial()
                {
                    Name        = "Basic Cheese Pizza",
                    Description = "Много вкусна. Защо не си вземеш една?",
                    BasePrice   = 9.99m,
                    ImageUrl    = "img/pizzas/cheese.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 2,
                    Name        = "The Baconatorizor",
                    Description = "Има ВСЕКИ вид бекон",
                    BasePrice   = 11.99m,
                    ImageUrl    = "img/pizzas/bacon.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 3,
                    Name        = "Classic pepperoni",
                    Description = "Пицата от твоето детство, но с повече люто!",
                    BasePrice   = 10.50m,
                    ImageUrl    = "img/pizzas/pepperoni.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 4,
                    Name        = "Buffalo chicken",
                    Description = "Пикантно пилешко едно от най-добрите",
                    BasePrice   = 12.75m,
                    ImageUrl    = "img/pizzas/meaty.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 5,
                    Name        = "Mushroom Lovers",
                    Description = "Има гъби.Очевидно",
                    BasePrice   = 11.00m,
                    ImageUrl    = "img/pizzas/mushroom.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 6,
                    Name        = "Veggie Delight",
                    Description = "Като салата, но върху пица",
                    BasePrice   = 11.50m,
                    ImageUrl    = "img/pizzas/salad.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 7,
                    Name        = "Margarita",
                    Description = "Традиционна италианска пица с домати и босилек",
                    BasePrice   = 9.99m,
                    ImageUrl    = "img/pizzas/margherita.jpg",
                },
            };

            db.Toppings.AddRange(toppings);
            db.Specials.AddRange(specials);
            db.SaveChanges();
        }
 public OrdersController(PizzaStoreContext storeContext)
 {
     this.storeContext = storeContext;
 }
 public MenuServiceImpl(PizzaStoreContext db)
 {
     _db = db;
 }
Beispiel #14
0
        public static void Initialize(PizzaStoreContext db)
        {
            var toppings = new Topping[]
            {
                new Topping()
                {
                    Name  = "Extra cheese",
                    Price = 2.50m,
                },
                new Topping()
                {
                    Name  = "American bacon",
                    Price = 2.99m,
                },
                new Topping()
                {
                    Name  = "British bacon",
                    Price = 2.99m,
                },
                new Topping()
                {
                    Name  = "Canadian bacon",
                    Price = 2.99m,
                },
                new Topping()
                {
                    Name  = "Tea and crumpets",
                    Price = 5.00m
                },
                new Topping()
                {
                    Name  = "Fresh-baked scones",
                    Price = 4.50m,
                },
                new Topping()
                {
                    Name  = "Bell peppers",
                    Price = 1.00m,
                },
                new Topping()
                {
                    Name  = "Onions",
                    Price = 1.00m,
                },
                new Topping()
                {
                    Name  = "Mushrooms",
                    Price = 1.00m,
                },
                new Topping()
                {
                    Name  = "Pepperoni",
                    Price = 1.00m,
                },
                new Topping()
                {
                    Name  = "Duck sausage",
                    Price = 3.20m,
                },
                new Topping()
                {
                    Name  = "Venison meatballs",
                    Price = 2.50m,
                },
                new Topping()
                {
                    Name  = "Served on a silver platter",
                    Price = 250.99m,
                },
                new Topping()
                {
                    Name  = "Lobster on top",
                    Price = 64.50m,
                },
                new Topping()
                {
                    Name  = "Sturgeon caviar",
                    Price = 101.75m,
                },
                new Topping()
                {
                    Name  = "Artichoke hearts",
                    Price = 3.40m,
                },
                new Topping()
                {
                    Name  = "Fresh tomatos",
                    Price = 1.50m,
                },
                new Topping()
                {
                    Name  = "Basil",
                    Price = 1.50m,
                },
                new Topping()
                {
                    Name  = "Steak (medium-rare)",
                    Price = 8.50m,
                },
                new Topping()
                {
                    Name  = "Blazing hot peppers",
                    Price = 4.20m,
                },
                new Topping()
                {
                    Name  = "Buffalo chicken",
                    Price = 5.00m,
                },
                new Topping()
                {
                    Name  = "Blue cheese",
                    Price = 2.50m,
                },
            };

            var specials = new PizzaSpecial[]
            {
                new PizzaSpecial()
                {
                    Name        = "Basic Cheese Pizza",
                    Description = "It's cheesy and delicious. Why wouldn't you want one?",
                    BasePrice   = 9.99m,
                    ImageUrl    = "img/pizzas/cheese.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 2,
                    Name        = "The Baconatorizor",
                    Description = "It has EVERY kind of bacon",
                    BasePrice   = 11.99m,
                    ImageUrl    = "img/pizzas/bacon.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 3,
                    Name        = "Classic pepperoni",
                    Description = "It's the pizza you grew up with, but Blazing hot!",
                    BasePrice   = 10.50m,
                    ImageUrl    = "img/pizzas/pepperoni.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 4,
                    Name        = "Buffalo chicken",
                    Description = "Spicy chicken, hot sauce and bleu cheese, guaranteed to warm you up",
                    BasePrice   = 12.75m,
                    ImageUrl    = "img/pizzas/meaty.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 5,
                    Name        = "Mushroom Lovers",
                    Description = "It has mushrooms. Isn't that obvious?",
                    BasePrice   = 11.00m,
                    ImageUrl    = "img/pizzas/mushroom.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 6,
                    Name        = "The Brit",
                    Description = "When in London...",
                    BasePrice   = 10.25m,
                    ImageUrl    = "img/pizzas/brit.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 7,
                    Name        = "Veggie Delight",
                    Description = "It's like salad, but on a pizza",
                    BasePrice   = 11.50m,
                    ImageUrl    = "img/pizzas/salad.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 8,
                    Name        = "Margherita",
                    Description = "Traditional Italian pizza with tomatoes and basil",
                    BasePrice   = 9.99m,
                    ImageUrl    = "img/pizzas/margherita.jpg",
                },
                new PizzaSpecial()
                {
                    Id          = 9,
                    Name        = "test",
                    Description = "test",
                    BasePrice   = 9.99m,
                    ImageUrl    = "img/pizzas/margherita.jpg",
                },
            };

            var dbDoughs = new DbDough[]
            {
                new DbDough
                {
                    Name        = "Thin Crust",
                    Description = "Thinnest Dough in restaurant",
                    Cost        = 7,
                    ImgSrc      = "img/dough/Thin-Crust-Pizza-Dough.jpg"
                },
                new DbDough
                {
                    Name        = "Flat Bread Crust",
                    Description = "It is pretty flat",
                    Cost        = 6,
                    ImgSrc      = "img/dough/flatbreadcrust-dough.jpg"
                }
            };

            var dbCheese = new DbCheese[]
            {
                new DbCheese
                {
                    Name        = "Mozzarella Cheese",
                    Description = "It is from italy",
                    Cost        = 3
                },
                new DbCheese
                {
                    Name        = "Cheddar Chesse",
                    Description = "Just Cheddar Chesse",
                    Cost        = 4
                }
            };

            var dbSausage = new DbSausage[]
            {
                new DbSausage
                {
                    Name        = "Kielbasa Sausage",
                    Description = "Kielbasa",
                    Cost        = 8
                },
                new DbSausage
                {
                    Name        = "Italian Sausage",
                    Description = "It is really import from Italy",
                    Cost        = 10
                }
            };

            db.Toppings.AddRange(toppings);
            db.Specials.AddRange(specials);

            db.SaveChanges();

            db.Doughs.AddRange(dbDoughs);
            db.Cheeses.AddRange(dbCheese);
            db.Sausages.AddRange(dbSausage);

            db.SaveChanges();
        }
Beispiel #15
0
 public ToppingsController(PizzaStoreContext storeContext)
 {
     this.storeContext = storeContext;
 }
 public OrdersController(PizzaStoreContext db)
 {
     _db = db;
 }
Beispiel #17
0
 public SuggestedOrderController(PizzaStoreContext context)
 {
     _context = context;
 }
 public SpecialsController(PizzaStoreContext db)
 {
     _db = db;
 }
 /// <summary>
 /// Initializes a new pizzastore repo given a suitable Entity Framework DbContext.
 /// </summary>
 /// <param name="db">The DbContext</param>
 public PizzaStoreRepo(PizzaStoreContext db)
 {
     _db = db ?? throw new ArgumentNullException(nameof(db));
 }
 public OrderDbsController(PizzaStoreContext context)
 {
     _context = context;
 }
 public PizzasController(PizzaStoreContext db)
 {
     _db = db;
 }
Beispiel #22
0
 public ToppingsController(PizzaStoreContext context)
 {
     this.Context = context;
 }
 public NotificationsController(PizzaStoreContext db)
 {
     _db = db;
 }
Beispiel #24
0
 public ToppingsController(PizzaStoreContext db)
 {
     _db = db;
 }
 public SpecialsController(PizzaStoreContext storeContext)
 {
     this.storeContext = storeContext;
 }