/// <summary> /// First Get from db then use Delete /// </summary> /// <param name="item"></param> public void Remove(StatusesForPatient item) { if (item != null) { control.Remove(item); } else { throw new Exception("This item not found in DataBase"); } }
public StatusesForPatient Get(int id, string status) { StatusesForPatient temp = control.GetAll().FirstOrDefault(x => x.Id == id || x.Status == status); if (temp != null) { return(temp); } else { throw new Exception("Not Found Status in DataBase"); } }
public StatusesForPatient Add(StatusesForPatient item) { StatusesForPatient temp = control.GetAll().FirstOrDefault(x => x.Status == item.Status); if (temp != null) { temp = control.Add(temp); control.SaveChanges(); return(temp); } else { throw new Exception("This Status alredy in base"); } }
public void Remove(StatusesForPatient item) { context.StatusesPatient.Remove(item); }
public StatusesForPatient Add(StatusesForPatient item) { return(context.StatusesPatient.Add(item)); }