private void ProcessExpiredOrderGoodses()
        {
            var expiredNormalGoodses = _orderGoodsQueryService.ExpiredNormalGoodses();

            if (expiredNormalGoodses.Any())
            {
                foreach (var expiredOrderGoods in expiredNormalGoodses)
                {
                    var command = new MarkAsExpireCommand()
                    {
                        AggregateRootId = expiredOrderGoods.Id
                    };
                    _commandService.SendAsync(command);
                }
            }
        }
Beispiel #2
0
 public void Handle(ICommandContext context, MarkAsExpireCommand command)
 {
     context.Get <OrderGoods>(command.AggregateRootId).MarkAsExpire();
 }