Example #1
0
 private static void CreateDatabase2()
 {
     using (var context = new BooksContext2())
     {
         context.Database.EnsureCreated();
         context.Books.Add(new Book("Professional C# 7 and .NET Core 2.0", "Wrox Press", "Christian Nagel"));
         context.SaveChanges();
     }
 }
Example #2
0
 private static void CreateDatabase2()
 {
     using (var context = new BooksContext2())
     {
         context.Database.EnsureCreated();
         context.Books.Add(new Book("Professional C# 6", "Wrox Press"));
         context.SaveChanges();
     }
 }