public static FullCommentViewModel ToMvcFullComment(this FullCommentEntity comment) { return new FullCommentViewModel() { Id = comment.Id, DateTime = comment.DateTime, Text = comment.Text, User = comment.User?.ToMvcUser(), ArticleId = comment.ArticleId }; }
public static DalComment ToDalComment(this FullCommentEntity fullComment) { DalComment comment = new DalComment() { Id = fullComment.Id, DateTime = fullComment.DateTime, Text = fullComment.Text, ArticleId = fullComment.ArticleId }; if (fullComment.User != null) { comment.UserId = fullComment.User.Id; } return(comment); }
public void UpdateCommentEntity(FullCommentEntity comment) { uow.CommentRepository.Update(comment.ToDalComment()); uow.Commit(); }