public ActionResult <ViewModelCollection <Product> > GetProducts()
        {
            var products = _products.GetAll();

            if (!products.Any())
            {
                return(NoContent());
            }

            var vm = ProductCollectionViewModel.From(Request, products);

            return(Ok(vm));
        }
Ejemplo n.º 2
0
 public IEnumerable <Product> GetAll()
 {
     return(_productAccessor.GetAll());
 }