I have the following class tructure:
public class Parent
{
public int Property1;
public int Property2;
public int Property3;
//Lots more properties
}
public class Child : Parent
{
public int Property80;
}
and a list of parent like this:
var parentList = new List<Parent>
{
//Some data....
};
I now want to make a new list of child that has all the data from parentList
I know I can do this:
var childList = parentList.Select(x => new Child { Property1 = x.Property1, Property2 = x.Property2, //etc }
but my question is, is there a shorthand or one line way of doing this, to save me having to write a huge list of properties out?