public void Add(params string[] translations) { bool isComplete = true; for (int i = 0; i < Languages.Length && isComplete; i++) { if (translations[i] == "") { isComplete = false; } } if (isComplete) { if (Array.Exists(translations, t => t.Contains(WordSeparator[0].ToString()))) { throw new InvalidDataException($"'{WordSeparator[0]}' is not an allowed character."); } else { ListOfWords.Add(new Word(translations)); } } else { throw new ArgumentException($"The word '{translations[0]}' was not added since it wasn't translated to all languages."); } }
public void CreateDictionary(List <MedicalService> BillItemList) { foreach (MedicalService BI in BillItemList) { ListOfWords.Add(BI.Name); } }