Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/319.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用JsonConstructorAttribute的Newtonsoft替代方案_C#_Json.net - Fatal编程技术网

C# 使用JsonConstructorAttribute的Newtonsoft替代方案

C# 使用JsonConstructorAttribute的Newtonsoft替代方案,c#,json.net,C#,Json.net,我已经使用newtonsoft json序列化程序将一个对象序列化为json 现在我想反序列化它,我的对象是不可变的,它包含两个构造函数,都带有参数。我必须使用属性JsonConstructorAttribute来装饰第二个 它工作得很好 但是 我不喜欢使用属性来装饰我的构造函数,有没有其他方法来指定它

我已经使用newtonsoft json序列化程序将一个对象序列化为json

现在我想反序列化它,我的对象是不可变的,它包含两个构造函数,都带有参数。我必须使用属性JsonConstructorAttribute来装饰第二个

它工作得很好

但是

我不喜欢使用属性来装饰我的构造函数,有没有其他方法来指定它