Пример #1
0
        public async Task <BaseResponseViewModel> AddCommentAsync(int questionId, string comment)
        {
            var questionComment = new QuestionComment();

            questionComment.Comment    = comment;
            questionComment.QuestionId = questionId;
            questionComment.CreatedAt  = DateTime.Now;
            questionComment.UpdatedAt  = DateTime.Now;
            questionComment.Author     = this.currentUser;

            await this.questionCommentRepository.AddAsync(questionComment);

            await this.uow.SaveChangesAsync();

            var response = new BaseResponseViewModel();

            response.Id = questionComment.Id;

            return(response);
        }
Пример #2
0
        public async Task <BaseResponseViewModel> AddCommentAsync(int answerId, string comment)
        {
            var answerComment = new AnswerComment();

            answerComment.Comment   = comment;
            answerComment.AnswerId  = answerId;
            answerComment.CreatedAt = DateTime.Now;
            answerComment.UpdatedAt = DateTime.Now;
            answerComment.Author    = this.currentUser;

            await this.answerCommentRepository.AddAsync(answerComment);

            await this.uow.SaveChangesAsync();

            var response = new BaseResponseViewModel()
            {
                Id = answerComment.Id
            };

            return(response);
        }
Пример #3
0
 public EmployeeResponse()
 {
     Messages = new BaseResponseViewModel();
     Result   = new EmployeeResponseDTO();
 }
Пример #4
0
 public EmployeesResponse()
 {
     Messages = new BaseResponseViewModel();
     Result   = new List <EmployeeResponseDTO>();
 }