Exemplo n.º 1
0
        public bool Delete(int id)
        {
            var user = db.Users.FirstOrDefault(u => u.UserId == id);

            if (user == null)
            {
                return(false);
            }
            db.Remove(user);
            return(db.SaveChanges() > 0);
        }
Exemplo n.º 2
0
        public bool Delete(int id)
        {
            var answer = db.Answers.FirstOrDefault(a => a.AnswerId == id);

            if (answer == null)
            {
                return(false);
            }
            db.Remove(answer);
            return(db.SaveChanges() > 0);
        }
Exemplo n.º 3
0
        public bool Delete(int id)
        {
            var question = db.Questions.FirstOrDefault(q => q.QuestionId == id);

            if (question == null)
            {
                return(false);
            }
            db.Remove(question);
            return(db.SaveChanges() > 0);
        }
Exemplo n.º 4
0
        public bool Delete(int id)
        {
            var postTopic = db.PostTopics.FirstOrDefault(pt => pt.IdPostTopic == id);

            if (postTopic == null)
            {
                return(false);
            }
            db.Remove(postTopic);
            return(db.SaveChanges() > 0);
        }
Exemplo n.º 5
0
        public bool Delete(int id)
        {
            var Comment = db.Comments.FirstOrDefault(c => c.CommentId == id);

            if (Comment == null)
            {
                return(false);
            }
            db.Remove(Comment);
            return(db.SaveChanges() > 0);
        }
Exemplo n.º 6
0
        public bool Delete(int id)
        {
            var sovaUser = db.SovaUsers.FirstOrDefault(su => su.SovaUserId == id);

            if (sovaUser == null)
            {
                return(false);
            }
            db.Remove(sovaUser);
            return(db.SaveChanges() > 0);
        }
Exemplo n.º 7
0
        public bool Delete(int id)
        {
            var topic = db.Topics.FirstOrDefault(t => t.TopicId == id);

            if (topic == null)
            {
                return(false);
            }
            db.Remove(topic);
            return(db.SaveChanges() > 0);
        }
Exemplo n.º 8
0
        public bool Delete(int id)
        {
            var Marked = db.Markeds.FirstOrDefault(m => m.MarkedId == id);

            if (Marked == null)
            {
                return(false);
            }
            db.Remove(Marked);
            return(db.SaveChanges() > 0);
        }
Exemplo n.º 9
0
        public bool Delete(int id)
        {
            var History = db.Histories.FirstOrDefault(h => h.HistoryId == id);

            if (History == null)
            {
                return(false);
            }
            db.Remove(History);
            return(db.SaveChanges() > 0);
        }
Exemplo n.º 10
0
 public bool DeleteAnnotation(int id)
 {
     using (var db = new SovaContext())
     {
         var annotation = db.annotation.FirstOrDefault(c => c.AnnotationId == id);
         if (annotation == null)
         {
             return(false);
         }
         db.Remove(annotation);
         return(db.SaveChanges() > 0);
     }
 }