My LINQ statement looks like
My problem is that neither file.Attribute(Global.xnToKeep). nor file.Attribute(Global.xnProtected) are guaranteed to exist in file. So, I need to test their existence before testing what their value is. How do I do that in a LINQ statement?
= (from file in matchingsets.Elements<XElement>(Global.xnFile)
where (((string)file.Attribute(Global.xnToKeep).Value != "*") && ((string)file.Attribute(Global.xnProtected).Value != "*") &
View the full article