Beispiel #1
0
 public static void Initialize(UklonSiteContext context)
 {
     if (!context.AllOrdersUklon.Any())
     {
         context.AllOrdersUklon.AddRange(
             new Order()
         {
             Id          = 1,
             AddressFrom = "м. Хрещатик",
             AddressTo   = "м.Почайна",
             Phone       = "380501234567",
             Price       = 75,
             Canceled    = false,
         },
             new Order()
         {
             Id          = 2,
             AddressFrom = "м. Академгородок",
             AddressTo   = "м.Почайна",
             Phone       = "380504567123",
             Price       = 50,
             Canceled    = false,
         }
             );
         context.SaveChanges();
     }
 }
 public OrderController(UklonSiteContext context)
 {
     _orderRepository = new OrderRepository(context);
 }
 public OrderRepository(UklonSiteContext context)
 {
     _context = context;
 }