public ActionResult <Drug> GetALLDrugs() { List <DrugDetailsDTO> result = _drugService.GetAllDrugs(); if (result != null) { return(Ok(result)); } else { return(NoContent()); } }
public IActionResult GetAllDrugs() { try { // checking if drug is available var drug = _drugService.GetAllDrugs(); if (drug == null) { return(NotFound("No Drug Available")); } return(Ok(drug)); } catch (Exception e) { return(BadRequest("Error occured from " + nameof(DrugsApiController.GetAllDrugs) + " Error Message " + e.Message)); } }
public ActionResult <Drug> GetALLDrugs() { _log4net.Info("DrugMicroService : " + nameof(GetALLDrugs)); List <DrugDetailsDTO> result = _drugService.GetAllDrugs(); try { if (result != null) { return(Ok(result)); } else { return(NoContent()); } } catch (Exception e) { _log4net.Error("Exception Occured : " + e.Message + " from " + nameof(GetDrugByName)); return(BadRequest("Exception Occured")); } }
public List <Drug> GetAllDrugs() { return(drugServiceReference.GetAllDrugs()); }