public async Task <IActionResult> Index() { var auctions = await _bllAuctionData.GetAllAsync(); ViewBag.Auctions = auctions; ViewBag.ActiveAuctionInfo = await _bllActiveAuction.GetAllAsync(); ViewBag.ActiveAuction = await _bllAuctionData.GetAsync(ViewBag.ActiveAuctionInfo[0].AuctionId); return(View(Mapper.AuctionDataMap(auctions))); }
public async Task <IActionResult> Index() { var activeEvents = new List <Event>(); var activeAuctions = Mapper.ActiveAuctionsMap(await _bllActiveAuctions.GetAllAsync()); foreach (var obj in activeAuctions) { if (obj.Opened) { activeEvents = Mapper.EventsMap(await _bllEvents.GetAllByAuctionId(obj.AuctionId)).ToList(); } } var itemsBo = new List <BO.Item>(); foreach (var obj in activeEvents) { itemsBo.Add(await _bllItems.GetAsync(obj.ItemId)); } ViewBag.Items = Mapper.ItemsMap(itemsBo); return(View(activeEvents)); }