// GET: Product
        //[OutputCache(Duration = 60)]
        public ActionResult Index()
        {
            try
            {
                //throw new Exception("Excepcion de prueba");

                var products = _logicaNegocio.SeleccionarTodos();
                return(View(products));
            }
            catch (Exception ex)
            {
                ViewBag.DescripcionError = ex.Message;
                return(View("Error"));
            }
        }
        public IEnumerable <Product> GetAllProducts()
        {
            var products = _logicaNegocio.SeleccionarTodos()
                           .Select(p => new Product {
                ProductID       = p.ProductoID,
                Nombre          = p.Nombre,
                Precio          = p.Precio,
                CategoriaID     = p.CategoriaID,
                CategoriaNombre = p.Categoria.Nombre
            });

            return(products);
        }