public async Task <CopyInvoiceResponse> Handle(CopyInvoiceCommand request, CancellationToken cancellationToken) { await _invoiceDomainEntity.GetAsNewCopyAsync(request.Id, cancellationToken); await _invoiceDomainEntity.CreateAsync(cancellationToken); return(new CopyInvoiceResponse { Id = _invoiceDomainEntity.EntityId }); }
public async Task <CreateInvoiceResponse> Handle(CreateInvoiceCommand request, CancellationToken cancellationToken) { await _invoiceDomainEntity.NewAsync(cancellationToken); _invoiceDomainEntity.MapFrom(request, _mapper); await _invoiceDomainEntity.CreateAsync(cancellationToken); return(new CreateInvoiceResponse { Id = _invoiceDomainEntity.EntityId }); }