示例#1
0
        public async Task <IActionResult> Vote()
        {
            //return Redirect(urlToRedirect);

            var email = this.GetUserEmail();
            var vote  = await _votesRepository.GetAsync(email);

            if (vote != null)
            {
                return(RedirectToAction("Success"));
            }


            var user = this.GetUser();

            var viewModel = new VoteViewModel {
                User = user.FirstName + " " + user.LastName
            };

            return(View(viewModel));
        }