Exemplo n.º 1
0
        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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 4
0
 public Ticket Find(int id)
 {
     return(_context.FindById <Ticket>(id));
 }
Exemplo n.º 5
0
 public Category Find(int id)
 {
     return(_context.FindById <Category>(id));
 }
Exemplo n.º 6
0
 public Comment Find(int id)
 {
     return(_context.FindById <Comment>(id));
 }