public void AddComment(Comment comment)
 {
     comment.UserId      = _customUserService.GetCurrentUser().Id;
     comment.CommentDate = DateTime.Now;
     comment.IsActive    = true;
     _commentDal.Add(comment);  //Repository'ye gideceğiz..
     _commentDal.Save();
 }
Beispiel #2
0
        public void AddComment(CommentDto commentDto)
        {
            var addComment = new Comment()
            {
                UserId      = _customUserService.GetCurrentUser().Id,
                CommentDate = DateTime.Now,
                IsActive    = true,
                Content     = commentDto.Content, //TODO Kontrol
                PostId      = commentDto.PostId
            };

            _commentDal.Add(addComment);
            _commentDal.Save();


            //commentDto.UserId = _customUserService.GetCurrentUser().Id;
            //commentDto.CommentDate = DateTime.Now;
            //commentDto.IsActive = true;
            //_commentDal.Add(commentDto);  //Repository'ye gideceğiz..
            //_commentDal.Save();
        }