I am parsing an XML doc into a c# project to check if an Element named "Feature" exists. In c#, I am using what exist in the Feature Element to determine whether an if statement should run.
XML
<Projects>
<Project>
<Name>Test</Name>
<Feature>AutoDev;AutoRev</Feature>
</Project>
</Projects>
C#
var feature = (from project in XDocument.Load(xmlPath).Descendants("Project")
where project.Element("Name").Equals(Project)
select project.Element("Feature").Value).Single().Split(';');
if (names.Contains("Test"))
//then load ticket variables....
if (feature.Contains("AutoDev"))
//then do this....
Right now I receive an error: Sequence contains no elements
Using the any method was suggested when loading Feature to check if the element exist in the array. Not sure how to implement this though.