/// <summary> /// This is used when saving the value of a foreign key, e.g. when selected from a drop down. /// </summary> public void ExtractForeignKey(IDictionary dictionary, string value) { if (String.IsNullOrEmpty(value)) { // If the value is null, set all the FKs to null foreach (string fkName in ForeignKeyNames) { dictionary[fkName] = null; } } else { string[] fkValues = Misc.ParseCommaSeparatedString(value); Debug.Assert(fkValues.Length == ForeignKeyNames.Count); for (int i = 0; i < fkValues.Length; i++) { dictionary[ForeignKeyNames[i]] = fkValues[i]; } } }