public async Task <IActionResult> Get() { try { var persons = await _personQueries.GetAsync(); return(Ok(persons)); } catch (ArgumentException e) { return(StatusCode(StatusCodes.Status500InternalServerError, e.Message)); } }
public async Task <IActionResult> Get([Required] int id, CancellationToken token) { var result = await queries.GetAsync(id, token); return(GenerateResponse(result)); }