Exemplo n.º 1
0
 public async Task <IActionResult> Get()
 {
     try
     {
         return(Ok(_mapper.Map <IEnumerable <Field>, IEnumerable <FieldView> >(await _fieldRepository.AllIncludingAsync(x => x.Company))));
     }
     catch (Exception e)
     {
         Log.Error(e, "FieldController.Get");
         return(BadRequest(_messageModelBuilder.CreateModel("500", e.Message)));
     }
 }