public bool DeletePost_tag(int id) { using (var db = new Sova()) { var post_tag = db.Post_tag.FirstOrDefault(pt => pt.id == id); if (post_tag == null) { return(false); } db.Remove(post_tag); return(db.SaveChanges() > 0); } }
public bool DeleteLinkpost(int id) { using (var db = new Sova()) { var linkpost = db.Linkpost.FirstOrDefault(lp => lp.linkpostid == id); if (linkpost == null) { return(false); } db.Remove(linkpost); return(db.SaveChanges() > 0); } }
public bool DeleteComment(int id) { using (var db = new Sova()) { var comment = db.Comments.FirstOrDefault(c => c.id == id); if (comment == null) { return(false); } db.Remove(comment); return(db.SaveChanges() > 0); } }
public bool DeleteUser(int id) { using (var db = new Sova()) { var user = db.User.FirstOrDefault(u => u.id == id); if (user == null) { return(false); } db.Remove(user); return(db.SaveChanges() > 0); } }
public bool DeleteTags(int id) { using (var db = new Sova()) { var tags = db.Tags.FirstOrDefault(ta => ta.id == id); if (tags == null) { return(false); } db.Remove(tags); return(db.SaveChanges() > 0); } }