Пример #1
0
        public ValidationStateDictionary AddPost(Post post)
        {
            post.ID = Guid.NewGuid();

            AddedPosts.Add(post);

            return(new ValidationStateDictionary(typeof(Post), new ValidationState()));
        }
Пример #2
0
        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));
        }
Пример #3
0
        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;
        }