Пример #1
0
 public async Task <IActionResult> Get(string countryCode)
 {
     try
     {
         return(await Task.Run <IActionResult>(() => new OkObjectResult(new GenericResponseMessage <CountryBo>(_countryManager.Get(countryCode)))));
     }
     catch (Exception ex)
     {
         return(new BadRequestObjectResult(new BadRequestObjectResult(new GenericResponseMessage <CompanyBo>
         {
             Errors = new List <string> {
                 ex.Message
             },
             StatusCode = HttpStatusCode.BadRequest
         })));
     }
 }