Ejemplo n.º 1
0
            protected override async Task Handle(
                [NotNull] DeleteGoodsItemByIdCommand request,
                CancellationToken cancellationToken)
            {
                Guard.NotNull(request, nameof(request));

                var goodsItem = await _goodsRepository
                                .GetByIdAsync(request.Id, cancellationToken)
                                .ConfigureAwait(false);

                if (goodsItem != null)
                {
                    await _goodsRepository
                    .DeleteAsync(goodsItem, cancellationToken)
                    .ConfigureAwait(false);
                }
            }