public ActionResult <Prescription> Get(long id) { var service = new PrescriptionService(); var prescription = service.GetID(id); if (prescription == null) { return(NotFound()); } return(prescription); }
public ActionResult Delete(long id) { var service = new PrescriptionService(); var prescription = service.GetID(id); if (prescription == null) { return(NotFound()); } service.Delete(prescription); return(Ok()); }
public ActionResult <Prescription> Put(long id, [FromBody] Prescription prescription) { var service = new PrescriptionService(); if (service.GetID(id) == null) { return(NotFound()); } prescription.PrescriptionID = id; service.Store(prescription); return(prescription); }