public HttpResponseMessage PesquisarCheques(string emitente, string banco) { try { var model = new List <ChequeViewModel>(); var result = _financeiroService.PesquisarCheques(emitente, banco, base.GetUsuarioLogado().IdClinica); if (result.Count > 0) { Mapper.CreateMap <Cheque, ChequeViewModel>(); Mapper.CreateMap <Pessoa, PessoaViewModel>(); Mapper.CreateMap <Financeiro, FinanceiroViewModel>(); model = Mapper.Map <List <Cheque>, List <ChequeViewModel> >(result.ToList()); } return(Request.CreateResponse(HttpStatusCode.OK, model)); } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message)); } }