示例#1
0
        public IActionResult Index()
        {
            var viewModel = new InventariosIndexViewModel()
            {
                Inventarios = Mapper.Map <List <InventarioViewModel> >(_inventario.GetAll())
            };

            return(View(viewModel));
        }
示例#2
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 Inventarios"));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, items));
        }