public async Task <IActionResult> GetAthletes() { var response = new ListModelResponse <Athlete>() as IListModelResponse <Athlete>; try { response.Model = await Task.Run(() => { return(_context.GetAthletes()); }); } catch (Exception ex) { response.DidError = true; response.ErrorMessage = ex.Message; } return(response.ToHttpResponse()); }
public async Task <IActionResult> Index() { return(View(await _athleteService.GetAthletes())); }
public IActionResult GetAthletes() { return(Json(_context.GetAthletes())); }