I have three classes -
public class Type
{
public int TypeId {get;set;}
public string TypeName {get;set;}
}
public class SubType
{
public int SubTypeId {get;set;}
public string SubTypeName {get;set;}
}
public class Association
{
public int TypeId {get;set;}
public int SubTypeId {get;set;}
}
The Association gives the mapping between Type and SubType.
I have lists of each class - List<Type>, List<SubType>, List<Association>.
I want to merge them all into another like this - List<TypeInfo>.
The TypeId and SubTypeId coming from the Assoication, the TypeName coming from Type and the SubTypeName coming from SubType.
public class TypeInfo
{
public int TypeId {get;set;}
public string TypeName {get;set;}
public int SubTypeId {get;set;}
public string SubTypeName {get;set;}
}
Is there an easy way with linq?