public bool Teach(LanguageStudent student, string language) { student.Languages.Add(language); if (Languages.Where(l => l == language).Any()) { return(true); } return(false); }
public static void Main(string[] args) { LanguageTeacher teacher = new LanguageTeacher(); teacher.AddLanguage("English"); LanguageStudent student = new LanguageStudent(); teacher.Teach(student, "English"); foreach (var language in student.Languages) { Console.WriteLine(language); } }