Here are two C# classes...
public class Address
{
public string Country;
public string City;
}
public class Traveller
{
public string Name;
public List<Address> TravelRoute;
}
... and a list of data (filled somewhere) ...
List<Traveller> Travellers;
... and then this LINQ query:
var result = from t in Travellers
where t.TravelRoute.Any(a => a.Country == "F")
select t;
foreach (var t in result)
System.Console.WriteLine(t.Name);
I do not understand the query: What means the "Any" function and what does the "=>" operator do?
Can someone explain me what's going on in this code? Thanks!