public Comment Add(Comment comment)
{
try
{
var dbComment = CommentMapper.ToEntity(comment);
dbComment.User = null;
var dbResult = _commentRepository.Add(dbComment);
dbResult.User = _userRepository.Find(a => a.UserId == comment.User.Id, false).FirstOrDefault();
return CommentMapper.ToDto(dbResult);
}
catch (Exception ex)
{
throw new BlogException(ex.Message, ex.InnerException);
}
}