Re: Newbie generics question
Code:
var rootlist = ObjectList.Load(filepath);
IList<MyObject> = rootlist.MyObject;
You are obviously talking about
Code:
var rootlist = ObjectList.Load(filepath);
IList<MyObject> myElements = rootlist.MyObject;
The myElements List will contain all your MyObject objects so whats the problem ? IList is already generic as you see so whats the problem ? If you have for example objects of customers and objects of products and other very different objects you cannot do other then building different lists for each of them like
Code:
IList<Customer> customers= rootlist.Customers;
IList<Product> product = rootlist.products;
This cannot be simplified any more IMHO
Re: Newbie generics question
Yeah, sorry, typo there. The problem is that I don't want to write a separate load function for each of my 40+ xsd files (and hence object types). I want to write one generic load function that returns a list of the relevant object types.