If your class has a property that is declared as an 'System.Object', but a instance of a proper class is there, GeorgeCloney creates a new plain object. The desired effect would be to have the actual instance of the type cloned.
class Foo
{
public object SomeObject { get; set; }
}
class Bar
{
public int SomeValue { get; set; }
}
var foo = new Foo { SomeObject = new Bar { SomeValue = 10 } };
var clone = foo.DeepClone();
Console.WriteLine(clone.Bar is Bar); // prints False
If your class has a property that is declared as an 'System.Object', but a instance of a proper class is there, GeorgeCloney creates a new plain object. The desired effect would be to have the actual instance of the type cloned.