public async Task <ActionResult <CitizenDataResponseModel> > GetCitizenByCpr([Required][FromRoute] string cprNumber) { var result = await _citizenService.GetCitizenByCprAsync(cprNumber).ConfigureAwait(false); if (result.IsError) { return(StatusCode((int)(result.StatusCode ?? HttpStatusCode.BadRequest), result.Error.Errors)); } else { return(Ok(result.Result)); } }