I have two C# (3.5) types that are different from each other. I do not control them so I can not make them inherit from a common type or implement an interface. But they are very similar in ‘shape’:
class A { string Name string Data } class B { string Title string OtherStuff } class C { string ID string ExtendedData } List< A > myAList List< B > myBList
I would like to do the following with a LINQ query:
Return all the elements in lists myAList and myBList ordered by Name or Title (whatever applies) the result must be a List< C > where ID = Name or Title and ExtendedData = Data or OtherStuff
Thoughts?
1 Answer