public async Task <ActionResult <CitizenList> > GetAllActiveCitizens([FromQuery] int pageNumber = 1) { var result = await _citizenService.GetAllActiveCitizensAsync(pageNumber).ConfigureAwait(false); if (result.IsError) { return(StatusCode((int)(result.StatusCode ?? HttpStatusCode.BadRequest), result.Error.Errors)); } else { return(Ok(result.Result)); } }