public async void GetAllPracticesTest() { try { var practices = await _service.GetAllPractices(); Assert.NotNull(practices); } catch (Exception e) { Console.WriteLine(e); throw; } }
public async Task <IActionResult> GetAllPractices() { try { var practices = await _service.GetAllPractices(); if (practices == null) { return(NotFound()); } return(new ObjectResult(practices)); } catch (Exception ex) { Log.Error(ex, ex.Message); return(BadRequest(ex.Message)); } }