Ejemplo n.º 1
0
        public async Task <Unit> Handle(UpdateInvoiceCommand request, CancellationToken cancellationToken)
        {
            await _invoiceDomainEntity.GetAsync(request.Id, cancellationToken);

            _invoiceDomainEntity.MapFrom(request, _mapper);

            await _invoiceDomainEntity.UpdateAsync(cancellationToken);

            return(Unit.Value);
        }
        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
            });
        }