public ServerResult <User> deleteById(string id, bool withMsg = true) { ServerResult <User> sr = getById(id, withMsg); if (sr.success) { try{ sr.result = db.User.Find(id); db.Remove(sr.result); db.SaveChanges(); sr.error.addInfo(HttpError.getDeleteIdFromTable(TabelList.User, id)); } catch { sr.error.addInfo(HttpError.getIdNotExist(TabelList.User, id)); } } return(sr); }