Beispiel #1
0
 public Post Update(Post post)
 {
     DbEntityEntry entry = _context.Entry(post);
     entry.State = EntityState.Modified;
     _context.SaveChanges();
     return post;
 }
Beispiel #2
0
        public Post Update(Post Post)
        {
            Validator.Validate(Post);

            var updatePost = _postRepository.Update(Post);
            return updatePost;
        }
Beispiel #3
0
        public Post Create(Post post)
        {
            Validator.Validate(post);

            var savePost = _postRepository.Save(post);
            return savePost;
        }
Beispiel #4
0
 public Post Save(Post Post)
 {
     var newPost = _context.Posts.Add(Post);
     _context.SaveChanges();
     return newPost;
 }