Mahatma Gandhi
Mahatma Gandhi

Reputation: 93

C# RestSharp v107 -> How use DeserializationAs

i woudl like to upgrade RestSharp Nuget from 106 to 107 version. In 106 version i using RestSharp.Deserializers namespace and tag like below

[DeserializeAs(Name = "testinfo")]
public string Testinfo{ get; set; }

In version 107 this is no longer used, does anyone know how to keep the same functionality in the newer version

Upvotes: 3

Views: 1134

Answers (1)

Alexey Zimarev
Alexey Zimarev

Reputation: 19610

If you use JSON, the documentation clearly mentions that the default serializer for v107 is System.Text.Json.

The serializer documentation is available, so you should get all the information you need there.

In particular, you can override the property name by using the JsonPropertyName attribute, as described on the docs page I mentioned just above.

Upvotes: 1

Related Questions