NullReference from API JSON

Hello, I'm trying to retrieve some data from TMDB API, but there's this attribute that is named "watch/providers" in the JSON, and in my Model I can't name it like this because of the "/", so my method returns null for this specific data because it won't match the JSON. Is there anyway to retrieve this data having the Model attribute with a different name from the JSON?
2 Replies
Angius
Angius7mo ago
You can use [JsonPropertyName] attribute Or [JsonProperty] I can never remember which one's for Newtonsoft and which one for STJ
Murilo Barbosa
Murilo Barbosa7mo ago
Then I need to use STJ for serialization I'm using DataContractJsonSerializer I'll try that Yes, it worked!