I'm new to C# and LINQ. I have the following bit of code to extract from an XML:
var objects = from elem in xml
select new
{
Obj1 = new Obj1((elem.Element("key1")).Value),
Obj2 = new Obj2((elem.Element("key2")).Value)
};
The objects is an Enumerable. Is there a way that I can get this as a Tuple where in I can access the Obj1 and Obj2 directly without the need to iterate?
xmland what is structure of xml you are parsing? How many elements your xml have? Dokey1andkey2exist always?