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

            yield return(new FoodPrepared
            {
                Id = c.Id,
                MenuNumbers = c.MenuNumbers
            });
        }
예제 #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
            });
        }