public IActionResult AddLike(int questionId) { var repository = new QuestionsRepository(_conn); var u = repository.GetUserByEmail(User.Identity.Name); repository.AddLike(questionId, u); return(Redirect($"/home/questionpage?id={questionId}")); }
public void Like(int id) { var repo = new QuestionsRepository(_connectionString); var email = User.Identity.Name; var userId = repo.GetByEmail(email).Id; repo.AddLike(id, userId); }
public void Like(Like like) { var repo = new QuestionsRepository(_connectionString); repo.AddLike(like); }