Exemplo n.º 1
0
        public async Task <ActionResult> Index()
        {
            var lotteryEvents = await eventService.GetAllEventsAsync();

            var eventsViewModel = mapper.Map(lotteryEvents, new List <LotteryEventViewModel>());

            ViewBag.EventsAvailable = await eventService.EventsByProgessTypeCountAsync("Available");

            ViewBag.EventsInProgress = await eventService.EventsByProgessTypeCountAsync("In progress");

            ViewBag.EventsClosed = await eventService.EventsByProgessTypeCountAsync("Closed");

            return(View(eventsViewModel));
        }
Exemplo n.º 2
0
        public async Task <IEnumerable <LotteryEventDTO> > GetAllEventsAsync()
        {
            var events = await eventService.GetAllEventsAsync();

            return(mapper.Map(events, new List <LotteryEventDTO>()));
        }