コード例 #1
0
ファイル: Delete.cs プロジェクト: maddenvvs/fawn-backend-poc
            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);
                }
            }