public void RemoveTicket(int id)
        {
            var ticketSet = _context.Set <Ticket>();
            var ticket    = _context.FindById <Ticket>(id);

            if (ticket == null)
            {
                return;
            }
            ticketSet.Remove(ticket);
            _context.SaveChanges();
        }
示例#2
0
        public void RemoveCategory(int id)
        {
            var categorySet = _context.Set <Category>();
            var category    = _context.FindById <Category>(id);

            if (category == null)
            {
                return;
            }
            categorySet.Remove(category);
            _context.SaveChanges();
        }
示例#3
0
        public void RemoveComment(int id)
        {
            var commentSet = _context.Set <Comment>();
            var comment    = _context.FindById <Comment>(id);

            if (comment == null)
            {
                return;
            }
            commentSet.Remove(comment);
            _context.SaveChanges();
        }
示例#4
0
 public Ticket Find(int id)
 {
     return(_context.FindById <Ticket>(id));
 }
 public Category Find(int id)
 {
     return(_context.FindById <Category>(id));
 }
示例#6
0
 public Comment Find(int id)
 {
     return(_context.FindById <Comment>(id));
 }