예제 #1
0
 public void Update(User obj)
 {
     using (var db = new CalcContext())
     {
         db.Entry(obj).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
예제 #2
0
 public void Delete(long Id)
 {
     using (CalcContext db = new CalcContext())
     {
         User delUser = db.Users.FirstOrDefault(c => c.Id == Id);
         if (delUser != null)
         {
             delUser.Status = UserStatus.Dead;
         }
         db.SaveChanges();
     }
 }