public IEnumerable <IEvent> Handle(MarkFoodServed c) { if (!IsFoodPrepared(c.MenuNumbers)) { throw new FoodNotPrepared(); } yield return(new FoodServed { Id = c.Id, MenuNumbers = c.MenuNumbers }); }
public IEnumerable Handle(Func <Guid, TabAggregate> al, MarkFoodServed c) { var tab = al(c.Id); if (!tab.IsFoodPrepared(c.MenuNumbers)) { throw new FoodNotPrepared(); } yield return(new FoodServed { Id = c.Id, MenuNumbers = c.MenuNumbers }); }