コード例 #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();
     }
 }
コード例 #2
0
 public OrderController(UklonSiteContext context)
 {
     _orderRepository = new OrderRepository(context);
 }
コード例 #3
0
 public OrderRepository(UklonSiteContext context)
 {
     _context = context;
 }