Esempio n. 1
0
        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));
            }
        }
Esempio n. 3
0
        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"));
            }
        }
Esempio n. 4
0
 public List <Drug> GetAllDrugs()
 {
     return(drugServiceReference.GetAllDrugs());
 }