Example #1
0
 public async Task<IActionResult> GetAllDiseases()
 {
     try
     {
         var diseases = await _diseaseRepository.GetAllDiseases();
         return Json(
               new
               {
                   Success = true,
                   Data = JsonConvert.SerializeObject(diseases)
               });
     }
     catch (Exception exception)
     {
         return Json(new { Success = false, exception.Message });
     }
 }