예제 #1
0
        public async Task <IHttpActionResult> Get()
        {
            var bll    = new BLL.Items();
            var result = await bll.GetAsync();

            return(Ok <IEnumerable <Entities.Item> >(result));
        }
예제 #2
0
        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));
        }