1- using Newtonsoft . Json ;
2- using System ;
1+ using System ;
32using System . Collections . Generic ;
43using System . Net ;
5- using System . Runtime . Serialization ;
6-
4+ using System . Runtime . Serialization ;
5+ using System . Text . Json . Serialization ;
6+
77namespace contentstack . CMA
88{
99 /// <summary>
@@ -13,7 +13,7 @@ namespace contentstack.CMA
1313 public class ContentstackException : Exception
1414 {
1515 #region Private Variables
16- private string _ErrorMessage = string . Empty ;
16+ private string _ErrorMessage = string . Empty ;
1717
1818 #endregion
1919
@@ -31,7 +31,7 @@ public class ContentstackException : Exception
3131 /// <summary>
3232 /// This is error message.
3333 /// </summary>
34- [ JsonProperty ( "error_message" ) ]
34+ [ JsonPropertyName ( "error_message" ) ]
3535 public string ErrorMessage
3636 {
3737 get
@@ -48,13 +48,13 @@ public string ErrorMessage
4848 /// <summary>
4949 /// This is error code.
5050 /// </summary>
51- [ JsonProperty ( "error_code" ) ]
51+ [ JsonPropertyName ( "error_code" ) ]
5252 public int ErrorCode { get ; set ; }
5353
5454 /// <summary>
5555 /// Set of errors in detail.
5656 /// </summary>
57- [ JsonProperty ( "errors" ) ]
57+ [ JsonPropertyName ( "errors" ) ]
5858 public Dictionary < string , object > Errors { get ; set ; }
5959
6060 #endregion
@@ -85,21 +85,21 @@ public ContentstackException(Exception exception)
8585 : base ( exception . Message , exception . InnerException )
8686 {
8787 this . ErrorMessage = exception . Message ;
88- }
89-
90- protected ContentstackException ( SerializationInfo info , StreamingContext context ) : base ( info , context )
91- {
92- }
93-
94- public ContentstackException ( string message , Exception innerException ) : base ( message , innerException )
95- {
96- }
97- public override void GetObjectData ( SerializationInfo info , StreamingContext context )
98- {
99- base . GetObjectData ( info , context ) ;
100- }
88+ }
89+
90+ protected ContentstackException ( SerializationInfo info , StreamingContext context ) : base ( info , context )
91+ {
92+ }
93+
94+ public ContentstackException ( string message , Exception innerException ) : base ( message , innerException )
95+ {
96+ }
97+ public override void GetObjectData ( SerializationInfo info , StreamingContext context )
98+ {
99+ base . GetObjectData ( info , context ) ;
100+ }
101101 #endregion
102102
103-
103+
104104 }
105105}
0 commit comments