예제 #1
0
 public void Remove(T entity)
 {
     using (var ctx = new BHMSContext())
     {
         ctx.Entry(entity).State = EntityState.Deleted;
         ctx.SaveChanges();
     }
 }
예제 #2
0
 public void Save(T model)
 {
     using (var ctx = new BHMSContext())
     {
         ctx.Entry(model).State = EntityState.Modified;
         ctx.SaveChanges();
     }
 }