I have a Cabin class that contains a list of Row objects. I\'d like to serialize the objects like this, but when deserializing I\'d like the Row objects to be RowRule objec
The problem with your sample code is, you're creating object of Row and trying to get RowRule which is not possible.
Row
RowRule
May be you wanted to do it like this:
var cabin = new Cabin(); var row = new RowRule(); // create derived object row.Status = "Success"; cabin.Rows = new List() { row, row };