var geoSettings = (from c in geoFields.Elements("Maps").Elements("Map")
select new
{
loc = c.Element("Location").Value
}).Distinct().Intersect(from p in terrainFields.Elements("Maps").Elements("Map")
select new
{
loc = p.Element("Location").Value
});
var flightCheck = from x in baseStations.Elements("BaseStation").Elements("Station")
// where (geoSettings.Location.Contains(x.Element("Location").Value))
select new
{
Flights = x.Element("FlightName").Value,
loc = x.Element("Location").Value
};
Les deux cartes et BaseStation sont xml files.I'm bloqués à // où (geoSettings.Location.Contains (x.Element ("Location"). Valeur)) geoSettings est un IEnumerable.Comment puis-je obtenir le "Emplacement"?XML LinQ contient dans la clause WHERE
Cant accéder à geoSettings.Location de cette façon parce que geoSettings est de type IEnumerable – Webbies
J'ai utilisé jointures et cela a fonctionné, merci pour l'idée, mais encore geoSettings.Location est incorrecte, donc je ne peux pas étiqueter votre réponse comme la bonne réponse. – Webbies