Пример #1
0
        public ActionResult Index()
        {
            var products = _productFacade.GetAll().Select(p => new ProductViewModel(p)).ToList();

            foreach (var product in products)
            {
                product.HasAuction = _auctionFacade.GetByProductId(product.Id)
                                     .Any(a => a.IsActive || a.StartTime > DateTime.Now) ||
                                     product.IsSold;
            }
            return(View(products));
        }
Пример #2
0
 public ActionResult <List <Product> > GetProducts()
 {
     return(Ok(_productFacade.GetAll()));
 }