// GET: /<controller>/
        public IActionResult Index()
        {
            InteractViewModel model = new InteractViewModel();

            ViewBag.Title = "Play with my code";
            return(View(model));
        }
Ejemplo n.º 2
0
        public void InteractWithJoke(InteractViewModel viewModel)
        {
            var userRepo = new UserRepository(_connectionString);
            var user     = userRepo.GetByEmail(User.Identity.Name);
            var jokeRepo = new JokesRepository(_connectionString);

            jokeRepo.InteractWithJoke(user.Id, viewModel.JokeId, viewModel.Like);
        }