public async Task <ActionResult> GetAgentList() { try { return(Ok(await _repository.GetAllAgents())); } catch (System.Exception) { return(StatusCode(StatusCodes.Status500InternalServerError, "There were error in retrieving the data from the database!")); } }
public async Task OnGet() { Agents = (await _repository.GetAllAgents()).ToList(); }