递归方法 :
decimal Salary(Employee e) { decimal s = e.salary; if (e.EmployeeCollection !=null) { foreach (Employee x in e.EmployeeCollection) { s += Salary(x); } } return s; }