Example #1
0
        public async Task <Unit> Handle(DeleteCustomerCommand request, CancellationToken cancellationToken)
        {
            await _customerDomainEntity.GetAsync(request.Id, cancellationToken);

            await _customerDomainEntity.DeleteAsync(cancellationToken);

            return(Unit.Value);
        }
        public async Task <Unit> Handle(UpdateCustomerCommand request, CancellationToken cancellationToken)
        {
            await _customerDomainEntity.GetAsync(request.Id, cancellationToken);

            _customerDomainEntity.MapFrom(request, _mapper);

            await _customerDomainEntity.UpdateAsync(cancellationToken);

            return(Unit.Value);
        }