예제 #1
0
 public static void Main()
 {
     using (var context = new LocalStoreContext())
     {
         // LocalStore(context); // 1. Local Store
         LocalStoreImprovement(context); // 2. Local Store Improvement
     }
 }
예제 #2
0
 private static void LocalStoreImprovement(LocalStoreContext context)
 {
     // Migration made through the Package Manager Console
     foreach (var product in context.Products)
     {
         Console.WriteLine(product + Environment.NewLine);
     }
 }
예제 #3
0
        private static void LocalStore(LocalStoreContext context)
        {
            //context.Database.Initialize(true);

            //context.Products.AddRange(new[]
            //{
            //    new Product("Banana", "Equador", 2.35M),
            //    new Product("Kiwi", "Tanzania", 2.99M),
            //    new Product("Orange", "Greece", 3.67M)
            //});

            //context.SaveChanges();
        }