I have a class :
public class Car
{
public string Color { get; set; }
public string Speed { get; set; }
}
And one instance :
List<Car> Cars = new List<Car>()
{
new Car()
{
Color = "Green".
Speed = "100"
},
new Car()
{
Color = "Yellow".
Speed = "150"
}
}
I want to filter this List
I do :
List<Car> Conditions = new List<Car>()
{
new Car()
{
Color = "Green".
Speed = "100"
},
new Car()
{
Color = "Yellow".
Speed = "100"
},
.......
}
How to browse my list and take only the car which corresponds at least to a condition with Linq?
Here, take only the first index of my list for example
