Exemplo n.º 1
0
        public HttpResponseMessage GetAll()
        {
            var items = c.GetAll();

            if (items.Count() == 0)
            {
                //Construyendo respuesta del servidor
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "No hay registros de clientes"));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, items));
        }
Exemplo n.º 2
0
        //Metodo Get
        public HttpResponseMessage GetAll()
        {
            conn.Configuration.ProxyCreationEnabled = false;
            var items = c.GetAll();

            if (items.Count() == 0)
            {
                //Construyendo respuesta del servidor
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "No hay registros"));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, items));
        }
Exemplo n.º 3
0
        public IActionResult Index()
        {
            var clienteModels = _clientes.GetAll();

            var listingResults = clienteModels.Select(result => new ClientesIndexListingModel
            {
                Id       = result.Id,
                Nome     = result.Nome,
                Endereco = _clientes.GetEndereco(result.Id),
                CPF      = _clientes.GetCPF(result.Id),
                EMail    = result.Email,
                Telefone = result.Telefone
            });
            var model = new ClienteIndexModel()
            {
                Clientes = listingResults
            };

            return(View(model));
        }
 public ActionResult <List <Cliente> > GetAll()
 {
     return(_cliente.GetAll());
 }