public bool Delete(int id) { var cabinet = dbContext.Cabinets.FirstOrDefault(c => c.Id == id); if (cabinet == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } dbContext.Remove(cabinet); dbContext.Commit(); return(true); }
public bool Delete(int id) { var user = dbContext.Users.FirstOrDefault(u => u.Id == id); if (user == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } dbContext.Remove(user); dbContext.Commit(); return(true); }
public bool Delete(int id) { var medication = dbContext.Medications.FirstOrDefault(m => m.Id == id); if (medication == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } dbContext.Remove(medication); dbContext.Commit(); return(true); }