public static void Initialize(OrderingSystemContext context)
        {
            context.Database.EnsureCreated();
            if (context.Items.Any())
            {
                return;
            }

            var items = new Item[]
            {
                new Item {
                    Price = 1.99, Active = true, OnHandBalance = 100, QuantityPerUnitOrdered = 10,
                },
                new Item {
                    Price = 2.99, Active = true, OnHandBalance = 0, QuantityPerUnitOrdered = 11,
                },
                new Item {
                    Price = 3.99, Active = false, OnHandBalance = 100, QuantityPerUnitOrdered = 8,
                },
                new Item {
                    Price = 4.99, Active = true, OnHandBalance = 100, QuantityPerUnitOrdered = 10,
                },
                new Item {
                    Price = 5.99, Active = true, OnHandBalance = 15, QuantityPerUnitOrdered = 10,
                },
                new Item {
                    Price = 6.99, Active = false, OnHandBalance = 100, QuantityPerUnitOrdered = 12,
                },
            };

            context.Items.AddRange(items);
            context.SaveChanges();
        }
 public DetailsModel(OrderingSystem.Data.OrderingSystemContext context)
 {
     _context = context;
 }
Exemplo n.º 3
0
 public CreateModel(OrderingSystem.Data.OrderingSystemContext context)
 {
     _context = context;
 }
Exemplo n.º 4
0
 public IndexModel(OrderingSystem.Data.OrderingSystemContext context)
 {
     _context = context;
 }
Exemplo n.º 5
0
 public EditModel(OrderingSystem.Data.OrderingSystemContext context)
 {
     _context = context;
 }