コード例 #1
0
 public void Update(T record)
 {
     using (var context = new BakeshoppeInventorySystem())
     {
         context.Entry(record).State = EntityState.Modified;
         context.SaveChanges();
     }
 }
コード例 #2
0
 public void Remove(T record)
 {
     using (var context = new BakeshoppeInventorySystem())
     {
         context.Entry(record).State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
コード例 #3
0
 public void UpdateRange(List <T> records)
 {
     using (var context = new BakeshoppeInventorySystem())
     {
         foreach (var record in records)
         {
             context.Entry(record).State = EntityState.Modified;
         }
         context.SaveChanges();
     }
 }