コード例 #1
0
        public HttpResponseMessage ListarMeiosdePagamentos()
        {
            try
            {
                var result = new List <MeioPagamentoViewModel>();

                var model = _financeiroService.ListarMeiosdePagamentos();
                if (model.Count > 0)
                {
                    Mapper.CreateMap <MeioPagamento, MeioPagamentoViewModel>();
                    result = Mapper.Map <List <MeioPagamento>, List <MeioPagamentoViewModel> >(model.ToList());
                }

                return(Request.CreateResponse(HttpStatusCode.OK, result));
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
            }
        }