/// <summary> /// lisof the complete menu /// </summary> /// <returns>List of the complete menu</returns> public static IEnumerable <IOrderItem> CompleteMenu() { List <IOrderItem> items = new List <IOrderItem>(); IEnumerable <IOrderItem> Entrees = Menu.Entrees(); foreach (IOrderItem item in Entrees) { items.Add(item); } IEnumerable <IOrderItem> Sides = Menu.Sides(); foreach (IOrderItem item in Sides) { items.Add(item); } IEnumerable <IOrderItem> Drinks = Menu.Drinks(); foreach (IOrderItem item in Drinks) { items.Add(item); } return(items.ToArray()); }
/// <summary> /// returns all menu items /// </summary> /// <returns></returns> public static IEnumerable <IOrderItem> CompleteMenu() { var drinks = Menu.Drinks(); var entrees = Menu.Entrees(); var sides = Menu.Sides(); var complete = entrees.Concat(sides).Concat(drinks); return(complete); }
static List <IOrderItem> MenuDatabase() { foreach (Entree item in Menu.Entrees()) { menuItems.Add(item); } foreach (Side item in Menu.Sides()) { menuItems.Add(item); } foreach (Drink item in Menu.Drinks()) { menuItems.Add(item); } return(menuItems); }
/// <summary> /// Static class returning a list of the complete menu. /// </summary> /// <returns>A list of the complete menu.</returns> public static IEnumerable <IOrderItem> CompleteMenu() { List <IOrderItem> menu = new List <IOrderItem>(); foreach (IOrderItem item in Menu.Entrees()) { menu.Add(item); } foreach (IOrderItem item in Menu.Sides()) { menu.Add(item); } foreach (IOrderItem item in Menu.Drinks()) { menu.Add(item); } return(menu); }
/// <summary> /// A list containing single instances of all menu items /// </summary> /// <returns></returns> public static IEnumerable <IOrderItem> All() { List <IOrderItem> complete = new List <IOrderItem>(); foreach (IOrderItem item in Menu.Entrees()) { complete.Add(item); } foreach (IOrderItem item in Menu.Sides()) { complete.Add(item); } foreach (IOrderItem item in Menu.Drinks()) { complete.Add(item); } return(complete); }
public static IEnumerable <IOrderItem> CompleteMenu() { List <IOrderItem> items = new List <IOrderItem>(); foreach (Entree e in Menu.Entrees()) { items.Add(e); } foreach (Side s in Menu.Sides()) { items.Add(s); } foreach (Drink d in Menu.Drinks()) { items.Add(d); } IEnumerable <IOrderItem> i = items; return(i); }
/// <summary> /// Filter by item type /// </summary> /// <param name="items"></param> /// <param name="type"></param> /// <returns></returns> public static IEnumerable <IOrderItem> FilterByType(IEnumerable <IOrderItem> items, string[] type) { if (type == null) { return(items); } if (type.Contains("Side")) { items.Concat(Menu.Sides()); } if (type.Contains("Entree")) { items.Concat(Menu.Sides()); } if (type.Contains("Drink")) { items.Concat(Menu.Drinks()); } return(items); }