Is any rule to detect that object is serializable in C#? [duplicate]
Possible Duplicate:
How to check if an object is serializable in C#
Recently found the following sente开发者_运维百科nce:
"Just to enhance, take a thumb rule, the object that support .ToString() are all serializable objects."
This looks like strange as all objects have .ToString() method so in this case all objects must be serializable. Is this sentence make sense?
Also is any rule to detect that specific object is serializable?
If found this article helpfull on this topic:
http://msdn.microsoft.com/en-us/library/ms973893.aspx
The ToString()
is not defined to serialize an object. You could implement a class that does have this behaviour but I don't think this would be a good idea.
And yep: already asked. Thought so...
How to check if an object is serializable in C#
精彩评论