Hi,
I am probably totally missing the point here but....
How can I pass a 'var' into another method?
(I am using linq to load XML into an Enumerable list of objects).
I have differernt object types (with different fields), but the final step of my process is the same regardless of which object is being used.
XNamespace xmlns = ScehmaName;
var result = from e in XElement.Load(XMLDocumentLocation).Elements(xmlns + ElementName)
select new Object1
{
Field1 = (string)e.Element(xmlns + "field1"),
Field2 = (string)e.Element(xmlns + "field2")
};
var result2 = Enumerable.Distinct(result);
This code will vary for the different type of XML files that will be processed. But I then want to iterate though the code to check for various issues:
foreach (var w in result2)
{
if (w.CheckIT())
{
//do something
}
}
What I would love is the final step to be in a method in the base class, and I can pass the 'var' varible into it from each child class.