Is it possible to create a generic IList method? Here’s how I want it to be implemented:
List<Entity1> lstEnt1 = _myClass.GenerateListFromXml<Entity1>(@"C\test.xml");
List<Entity2> lstEnt2 = _myClass.GenerateListFromXml<Entity1>(@"C\test.xml");
Here’s what I got so far:
public List<XMLModule> RetrieveListFromXml(string appSetting, string module)
{
throw new NotImplementedException();
}
I want to change the XMLModule to a generic one which I can pass in an entity.
Need help on this guys. Thanks!
Pretty simple, just use a generic T type and then decide the internal behavior.