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); }
public void InteractWithJoke(int jokeId, bool like) { var userRepo = new UserRepository(_connectionString); var user = userRepo.GetByEmail(User.Identity.Name); var jokeRepo = new JokesRepository(_connectionString); jokeRepo.InteractWithJoke(user.Id, jokeId, like); }