Ejemplo n.º 1
0
        public IEnumerable <IEvent> Handle(MarkDrinksServed c)
        {
            if (!AreDrinksOutstanding(c.MenuNumbers))
            {
                throw new DrinksNotOutstanding();
            }

            yield return(new DrinksServed
            {
                Id = c.Id,
                MenuNumbers = c.MenuNumbers
            });
        }
Ejemplo n.º 2
0
        public IEnumerable Handle(Func <Guid, TabAggregate> al, MarkDrinksServed c)
        {
            var tab = al(c.Id);

            if (!tab.AreDrinksOutstanding(c.MenuNumbers))
            {
                throw new DrinksNotOutstanding();
            }

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