C# serialize a class without a parameterless constructor

后端 未结 5 1915
予麋鹿
予麋鹿 2020-12-18 21:08

I\'m implementing a factory pattern for 3 different cryptography classes. The factory will determine which one to create and then get a serialized instance of the correct cl

5条回答
  •  悲&欢浪女
    2020-12-18 21:43

    DataContractSerializer does not require parameterless constructor. What it instead requires are special attributes of class.

提交回复
热议问题