Friday 15 July 2011

c# - If Base class is marked Serializable are all child classes marked too? -


I have a complete list of entity sections, which I need to serialize (due to the session being stored in SQL , But this is the second story).

I've added the attribute [serializable] and all look fine.

All my unit classes are extended from the same base class. If I mark the base class as serial jub, does it mean that all children have been marked as serial jubil?

Thanks

No, the inheritance has not been inherited.

When you increase the class, it is possible to add such features that can not be sorted by nature, so the .NET framework can not assume that you have all the detail of the serializable base class too serialized is.

This is the reason why you must explicitly specify the [serializable] attribute on each category.


No comments:

Post a Comment