List<T>转IEnumerable<T>
public static Polyline gettwoLine(double x1, double y1, double x2, double y2) { Coordinate2D p1 = new Coordinate2D(x1, y1); Coordinate2D p2 = new Coordinate2D(x2, y2); List<Coordinate2D> pList = new List<Coordinate2D>(); pList.Add(p1); pList.Add(p2); IEnumerable<Coordinate2D> coordinates = pList.AsEnumerable<Coordinate2D>(); //IEnumerable<Coordinate2D> coordinates =(p1,p2); var newPolyline = PolylineBuilder.CreatePolyline(coordinates); return newPolyline; }