private TicketItem CreateTicketItem(AddTicketItemCommand request) { return(new TicketItem { TicketId = request.TicketId, UserId = _workContext.CurrentUserId, Message = request.Message }); }
public async Task <Response <TicketItemViewModel> > Handle(AddTicketItemCommand request, CancellationToken cancellationToken) { var ticketItem = CreateTicketItem(request); await _repository.AddAsync(ticketItem); await HandleTicketInfo(ticketItem); return(Response <TicketItemViewModel> .Success(_mapper.Map <TicketItemViewModel>(GetTicketItem(ticketItem)))); }