Пример #1
0
        private void UpdateInfo(Post post, DalPost dalPost)
        {
            if (post == null || dalPost == null) throw new ArgumentNullException();

            post.Id = dalPost.Id;
            post.MembershipUser_Id = dalPost.User.Id;
            post.Topic_Id = dalPost.TopicId;
            post.DateCreated = dalPost.DateCreated;
            post.DateEdited = dalPost.DateEdited;
            post.PostContent = dalPost.PostContent;
            post.IsTopicStarter = dalPost.IsTopicStarter;
        }
Пример #2
0
 private Post ToOrmPost(DalPost dalPost)
 {
     if (dalPost == null) return null;
     var newPost = new Post();
     UpdateInfo(newPost, dalPost);
     return newPost;
 }