public ValidationStateDictionary AddPost(Post post) { post.ID = Guid.NewGuid(); AddedPosts.Add(post); return(new ValidationStateDictionary(typeof(Post), new ValidationState())); }
public ModelResult <Post> AddPost(PostInput postInput, EntityState state, User creator) { ValidationStateDictionary validationState = new ValidationStateDictionary(typeof(Post), new ValidationState()); Post post = new Post(null, null, null, false, DateTime.MinValue, creator, Guid.NewGuid(), null, DateTime.MinValue, null, null, state, null, null, null); AddedPosts.Add(post); return(new ModelResult <Post>(post, validationState)); }
public void AddPost(Post post, User currentUser, bool fireEvents, out ValidationStateDictionary validationState, out Post newPost) { validationState = new ValidationStateDictionary(typeof(Post), new ValidationState()); post.Creator = currentUser; post.ID = Guid.NewGuid(); AddedPosts.Add(post); newPost = post; }