Ejemplo n.º 1
0
        public IHttpActionResult GetAll()
        {
            try
            {
                //Mapeia os dados da fonte (source class) para o destino (destiny class)
                var lista = _clienteBusiness.GetAll().ToList().Select(Mapper.Map <Cliente, ClienteResponse>);

                var totalRegistros = lista.Count();

                //Monta response
                _result = Ok(Retorno <IEnumerable <ClienteResponse> > .Criar(true, "Consulta Realizada Com Sucesso", lista, totalRegistros, totalRegistros));

                //Retorna o response
                return(_result);
            }
            catch (Exception)
            {
                throw new HttpResponseException(HttpStatusCode.InternalServerError);
            }
        }
 public IEnumerable <ClienteViewModel> BuscarClientes()
 {
     return(Map <IEnumerable <ClienteViewModel> >(clienteBusiness.GetAll()));
 }
 public HttpResponseMessage GetAll()
 {
     return(Request.CreateResponse(HttpStatusCode.OK, m_ClienteBusiness.GetAll()));
 }
 public IEnumerable <ClienteDomain> GetAll()
 {
     return(_business.GetAll());
 }