I am trying to do the following:
- Given TypeInfo after reflecting on a LINQ-to-SQL object with various EntitySet<> child collections, retrieve the collection
- Do some operations on the collection
The code below does not compile, obviously - just looking for another way to do this [Note, "Facade" is the L2S object in question). The things that don't compile are the usages of "itemType" becuase it's a variable, not a Type name, but you get the idea:
//itemType is the reflected Type of child object
EntitySet<itemType> list = (EntitySet<itemType>)type.InvokeMember(
info.Name,
BindingFlags.GetProperty,
null,
Facade,
null);
foreach (itemType o in list)
//do something with o
The closest possible dupe I come up with is here, but there is no ultimate solution.
Thanks in advance for any ideas.