Beispiel #1
0
 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);
     }
 }
Beispiel #2
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);
     }
 }
Beispiel #3
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);
     }
 }
Beispiel #4
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);
     }
 }
Beispiel #5
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);
     }
 }