我正在使用LINQ .Find(),当它找到匹配时它不会停止.我有:
List<ipFound> ipList = new List<ipFound>();
ipFound ipTemp = ipList.Find(x => x.ipAddress == srcIP);
if (ipTemp == null) {
// this is always null
}
public class ipFound
{
public System.Net.IPAddress ipAddress;
public int bytesSent;
public int bytesReceived;
public int bytesTotal;
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?我在这里疯了.
谢谢!