public IList<Markers> getEngineerByCenterPoint(float latitude, float longitude)
{
MapAddress mapAddress = new MapAddress(latitude, longitude);
List<Markers> markers = (List<Markers>)getEngineerRecent();
List<MapAddress> maps = (List<MapAddress>)MapHelper.GetPointsByDistance(mapAddress,200000, markers);
//return markers.Where(a => maps.Exists(t => a.latitude.Equals(t.lat))).ToList(); 方法1
return markers.Where(a => maps.Where(t => a.latitude == t.lat).Any()).ToList(); // 方法2
//return markers.Where(a => !maps.Where(t => a.latitude == t.lat).Any()).ToList(); //除去交集数据,加 '!'
}
C# Lambda表达式 两个list取交集 做筛选
最新推荐文章于 2023-07-02 20:13:47 发布