public void DeleteHospitalSupply(int id) { HospitalSupply hospitalSupply = this._context.HospitalSupplies.FirstOrDefault(f => f.Id == id); this._context.HospitalSupplies.Remove(hospitalSupply); this._context.SaveChangesAsync(); }
public HospitalSupply UpdateHospitalSupply(ref HospitalSupply hospitalSupply) { this._context.Entry(hospitalSupply).State = EntityState.Modified; this._context.Entry(hospitalSupply).Property("LastUpdate").CurrentValue = DateTime.Now; this._context.SaveChangesAsync(); return(hospitalSupply); }
public ActionResult <HospitalSupply> UpdateHospitalSupply(HospitalSupply hospitalSupply) { this._serviceHospitalSupply.UpdateHospitalSupply(ref hospitalSupply); return(Ok(hospitalSupply)); }
public ActionResult <HospitalSupply> CreateSupplyCategory(HospitalSupply hospitalSupply) { this._serviceHospitalSupply.CreateHospitalSupply(ref hospitalSupply); return(new CreatedAtRouteResult("GetHospitalSupply", new { id = hospitalSupply.Id }, hospitalSupply)); }
public void CreateHospitalSupply(ref HospitalSupply hospitalSupply) { this._context.Add(hospitalSupply); this._context.SaveChangesAsync(); }