I have three lists which contains three same properties in each collection. I want to combine a result into one collection. Ex classes structure is as below
publ
You can use inheritance.
public class ResultCollection : Collection1
{
List Collection2s { get; set; }
List Collection3s { get; set; }
}
and then
var result = new ResultCollection {
PropId1 = Collection1.PropId1,
PropId2 = Collection1.PropId2,
...
Collection2s = Collection2,
Collection3s = Collection3
}
An automapper can be helpful here.
https://docs.automapper.org/en/stable/