public async Task <IActionResult> Get() { try { var result = await _petsService.GetCatsGroupedByOwnerGender().ConfigureAwait(false); return(Ok(result)); } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError, "An error occured while getting list of cats")); } }
public async Task OnGetAsync() { Groupings = await _petsService.GetCatsGroupedByOwnerGender(); }