public faculty SearchFaculty(string id) { faculty t = null; foreach (faculty f in faculties) { if (f.Id.Equals(id)) { t = f; } } return(t); }
static void Main(string[] args) { faculty f1 = new faculty("Tanvir Ahmed", "234566"); faculty f2 = new faculty("Kaniz Fatema", "098654"); department d1 = new department("CSE", "1234"); d1.ShowInfo(); d1.AddFaculty(f1, f2); d1.ShowAllFaculties(); var faculty = d1.SearchFaculty("234566"); if (faculty != null) { d1.DelateFaculty(faculty); } Console.WriteLine("delated"); d1.ShowAllFaculties(); }
public void DelateFaculty(faculty f) { faculties.Remove(f); }