Beispiel #1
0
 public void Edit(Entities.Cutter cutter)
 {
     using (var context = new ApplicationDbContext())
     {
         context.Entry(cutter).State = EntityState.Modified;
         context.SaveChanges();
     }
 }
Beispiel #2
0
 public void Add(Entities.Cutter cutter)
 {
     using (var context = new ApplicationDbContext())
     {
         context.Cutter.Add(cutter);
         context.SaveChanges();
     }
 }
Beispiel #3
0
 public void Delete(Entities.Cutter cutter)
 {
     using (var context = new ApplicationDbContext())
     {
         var deleteItem = context.Cutter.FirstOrDefault(a => a.Id == cutter.Id);
         if (deleteItem == null)
         {
             return;
         }
         context.Cutter.Remove(deleteItem);
         context.SaveChanges();
     }
 }