Exemplo n.º 1
0
 public static void UpdateModel(List <Models.Book> books)
 {
     //var optionsBuilder = new DbContextOptionsBuilder();
     //optionsBuilder.UseSqlServer("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=MyStuff;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False");
     //optionsBuilder.UseLoggerFactory(MyConsoleLoggerFactory);
     using (var BookCtx = new MyStuffdbContext(new DbContextOptions <MyStuffdbContext>()))
     {
         BookCtx.FavoriteBooks.AddRange(books);
         //BookCtx.FavoriteBooks.UpdateRange(books);
         BookCtx.SaveChanges();
     }
 }
Exemplo n.º 2
0
 public SqlProjectData(MyStuffdbContext context)
 {
     _context = context;
 }
Exemplo n.º 3
0
 public SqlBookData(MyStuffdbContext context)
 {
     _context = context;
 }