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); } } }
public void Handle(ICommandContext context, MarkAsExpireCommand command) { context.Get <OrderGoods>(command.AggregateRootId).MarkAsExpire(); }