public void Update(User obj) { using (var db = new CalcContext()) { db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); } }
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(); } }