What am I trying to do is as follows:
[serializable]
public class A
{
B b = new B();
}
public class B
{
public b()
{}
}
public class SerilizableCheker()
{
A a = new A();
if( a.IsSerializable) // true;
{
}
}
As B's object, in class A, is not serializable that is why it will throw an exception, when I go for serialization. Is there any method to find that objects in Class A are also serializable and if they arre not the throw an exception.
Reflection could be an option which is coming in mind but there could be an hierarchy of such aggregation of object. So is there any way to find it without manually fetching each contamination and then check for serialization ?
This Question is totally different as question is about replacement of IsSerializable attribute.