public static T Object <T>(List <T> objList, findFunc <T> compareFunc) { if (objList == null) { return(default(T)); } for (int i = 0; i < objList.Count; i++) { if (compareFunc(objList[i])) { return(objList[i]); } } return(default(T)); }
public static int Index <T>(List <T> objList, findFunc <T> compareFunc) { if (objList == null) { return(-1); } for (int i = 0; i < objList.Count; i++) { if (compareFunc(objList[i])) { return(i); } } return(-1); }