Adding a parameter to a FindAll for a Generic List in C#
问题 I have a list of objects that I want to filter by an integer parameter List<testObject> objectList = new List<testObject>(); // populate objectList with testObjects objectList.FindAll(GroupLevel0); private static bool GroupLevel0(testObject item) { return item._groupLevel == 0; } private class testObject { public string _FieldSQL = null; public int _groupLevel; } What I'm looking to do is to make GroupLevel0 take in an integer as a parameter instead of hardcoding to 0. I'm working in .NET 2.0