public void Register(RegisterTicketCommand command) { command.Validate(); if (AddNotifications(command)) { return; } TicketCategory category = _categoryRepository.GetById(command.CategoryId); LedgerIdentityUser user = _identityResolver.GetUser(); if (NotifyNullCategory(category)) { return; } Ticket ticket = _factory.OpenTicket(command.Title, command.Details, command.CategoryId, user.Id); _ticketRepository.Register(ticket); if (Commit()) { PublishLocal(new TicketRegisteredEvent(ticket.Id, ticket.Title, ticket.Details)); } }
public TicketCategory GetById(Guid id) { return(_repository.GetById(id)); }
public void deleteCategory(int id) { TicketCategory cat = categoryRepo.GetById(id); categoryRepo.Delete(cat); }