c# - How do I find all XML elements whose value is in a list of values using LINQ -



c# - How do I find all XML elements whose value is in a list of values using LINQ -

i need able find xml elements values can found in list of values grouping of xml elements. in other words homecoming of elements grouping value matches of elements grouping b. need accomplish using linq xml.

here's code. returns null. how prepare it?

ienumerable<xelement> myelements = e in groupa.elements("element") groupb.elements("element").tolist().contains(e) select e;

i think want

ienumerable<xelement> myelements = e in groupa.elements("element") groupb.elements("element").any(b => b.value == e.value) select e;

c# .net linq-to-xml

Comments

Popular posts from this blog

ruby on rails - Devise Logout Error in RoR -

model view controller - MVC Rails Planning -

php - Working with pretty urls on apache and fastcgi after hhvm installation -