There is nothing about MVC (Sorry, I read your post incorrectly). It is only about creating a simple C # 'py object. You see, take this class as an example:
public class Why { public Why(int x, int y) { } }
How does the deserializer know what to pass when your object is deserialized and built? He could not guess. Thus, the framework requires serializable objects to have constructors without parameters, so itβs safe to βjust createβ your responsibility . make all state accessible through properties.
note: by the way - note that the constructor should not be publicly available. Most serializers do very well with private constructors with no parameters or nothing at all if they are implemented to use an uninitialized object construct accessible from Reflection at least in the full .Net profile.
source share