Delete() public static method

public static Delete ( Post, post ) : void
post Post,
return void
        public ActionResult DeleteConfirmed(int id)
        {
            Post post = postManager.Find(x => x.Id == id);

            postManager.Delete(post);
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        public IActionResult Delete(int id)
        {
            var post = _postManager.GetPost(id);

            _postManager.Delete(post);
            return(RedirectToAction(nameof(Index)));
        }
Exemplo n.º 3
0
        public ServiceResult Delete(Post s)
        {
            if (s == null || string.IsNullOrWhiteSpace(s.UUID))
            {
                return(ServiceResponse.Error("Invalid account was sent."));
            }

            PostManager postManager = new PostManager(Globals.DBConnectionKey, this.GetAuthToken(Request));

            return(postManager.Delete(s));
        }
Exemplo n.º 4
0
        public ServiceResult Delete(string uuid)
        {
            if (string.IsNullOrWhiteSpace(uuid))
            {
                return(ServiceResponse.Error("Invalid id was sent."));
            }

            PostManager postManager = new PostManager(Globals.DBConnectionKey, this.GetAuthToken(Request));
            var         res         = postManager.Get(uuid);

            if (res.Code != 200)
            {
                return(res);
            }

            Post fa = (Post)res.Result;

            return(postManager.Delete(fa));
        }
Exemplo n.º 5
0
 public void Delete(int postId)
 {
     PostManager.Delete(postId);
 }
Exemplo n.º 6
0
 public void Delete(int id)
 {
     _repo.Delete(id);
 }