Esempio n. 1
0
        public IActionResult Index()
        {
            var model = _polls.GetAllPublic()
                        .Select(poll => new PollsListViewModel
            {
                Id         = poll.PollId,
                Question   = poll.Question,
                TotalVotes = poll.Answers.Sum(answer => answer.Votes)
            });

            return(View(model));
        }