public IEnumerable <IEvent> Handle(MarkFoodPrepared c)
        {
            if (!IsFoodOutstanding(c.MenuNumbers))
            {
                throw new FoodNotOutstanding();
            }

            yield return(new FoodPrepared
            {
                Id = c.Id,
                MenuNumbers = c.MenuNumbers
            });
        }
Exemple #2
0
        public IEnumerable Handle(Func <Guid, TabAggregate> al, MarkFoodPrepared c)
        {
            var tab = al(c.Id);

            if (!tab.IsFoodOutstanding(c.MenuNumbers))
            {
                throw new FoodNotOutstanding();
            }

            yield return(new FoodPrepared
            {
                Id = c.Id,
                MenuNumbers = c.MenuNumbers
            });
        }