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(); }
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(); }
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(); }
public Ticket Find(int id) { return(_context.FindById <Ticket>(id)); }
public Category Find(int id) { return(_context.FindById <Category>(id)); }
public Comment Find(int id) { return(_context.FindById <Comment>(id)); }