I have an IEnumerable<Point>
and I want to convert it to an IEnumerable<float>
.
Can I do this in a single Linq statement?
IEnumerable<float> ConvertToPoints(IEnumerable<Point> points)
{
List<float> floats = new List<float>();
foreach(var point in points)
{
floats.Add(point.X);
floats.Add(point.Y);
}
return floats;
}