Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给定一个 .net 4. 集合,如果我想在 where 子句中传入我自己的自定义函数,我该怎么做(通过参数)?
谢谢
Do you mean something like this?
public IEnumerable<string> FilterNames(Func<string, bool> filter) { return people.Select(person => person.Name) .Where(filter); }