Why is there a Serializable attribute [Serializable]
, when one can just serialize as below in Net Core?
var test= JsonSerializer.Serialize(MyObject)
What is the difference between these two?
Resources:
Why is there a Serializable attribute [Serializable]
, when one can just serialize as below in Net Core?
var test= JsonSerializer.Serialize(MyObject)
What is the difference between these two?
Resources:
Most JSON and XML formatter doesn't required [Serializable]
attribute when serializing an object. But some required it, like when you using BinaryFormatter
when serializing an object.
Article, Do we really need SerializableAttribute?