/// <summary> /// Generates a hashed value from the toppings in a sorted set. Used for easy grouping of duplicated topping configurations /// </summary> /// <param name="inputConfigs"></param> /// <returns>List<Topping> </returns> private static IEnumerable <Topping> HashConfigurations(IEnumerable <Topping> inputConfigs) { var configurations = new List <Topping>(); foreach (var inputConfig in inputConfigs) { var topping = new Topping() { ToppingHash = inputConfig.Toppings.Aggregate((i, j) => i + j), Toppings = inputConfig.Toppings, NumberOfOrders = 0 }; configurations.Add(topping); } return(configurations); }
public void AddTopping(Topping topping) { this.toppings.Add(topping); }