Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Employees : ICollection
- {
- public List<Employee> emps = new List<Employee>();
- private class NamePredicat
- {
- public string NameToFind = "";
- public NamePredicat(string Name)
- {
- this.NameToFind = Name;
- }
- public bool Predicat(Employee E)
- {
- return E.Name.Equals(NameToFind);
- }
- }
- public Employee Search(string Name)
- {
- NamePredicat P = new NamePredicat(Name);
- Employee E = emps.Find(P.Predicat);
- return E; // or null
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment