public Variant FindBySelectionData(OptionSelectionList selections, OptionList options) { var variantSelections = new OptionSelectionList(); foreach (var opt in options) { if (opt.IsVariant) { var sel = selections.FindByOptionId(opt.Bvin); if (sel != null) { variantSelections.Add(sel); } else { return(null); } } } var selectionKey = OptionSelection.GenerateUniqueKeyForSelections(variantSelections); return(FindByKey(selectionKey)); }
/// <summary> /// This method returns a unique ID that is comprised of the Bvins, separated by a pipe character. /// </summary> /// <returns>String - a unique ID using the Bvins of each selection</returns> public string UniqueKey() { return(OptionSelection.GenerateUniqueKeyForSelections(Selections)); }