Пример #1
0
        public IActionResult UpVote([FromRoute(Name = "id")] int id)
        {
            QuestionModel question = Idao.GetQuestionById(id);

            question.VoteUp();
            Idao.UpdateVoteNumber(question.Id, question.Vote, "question");

            UserModel user = Idao.GetUserById(question.User_Id);

            user.IncreaseReputation(5);
            Idao.UpdateUser(user);

            return(View("Question", question));
        }
Пример #2
0
        public IActionResult User(int id)

        {
            return(View("UserPage", Idao.GetUserById(id)));
        }