public void Delete(DalPost entity) { if (entity == null) throw new ArgumentNullException("entity"); Delete(entity.Id); }
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; }
public void Update(DalPost entity) { if (entity == null) throw new ArgumentNullException("entity"); var existedEntity = _dbSetPosts.Find(entity.Id); UpdateInfo(existedEntity, entity); }
private Post ToOrmPost(DalPost dalPost) { if (dalPost == null) return null; var newPost = new Post(); UpdateInfo(newPost, dalPost); return newPost; }
public void Insert(DalPost entity) { if (entity == null) throw new ArgumentNullException("entity"); _dbSetPosts.Add(ToOrmPost(entity)); }