MAK
MAK

Reputation: 1288

Set Property name and Null Value Handling on JsonProperty

I have my Property set like this:

[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string TId { get; set; }

I also want to be able to make sure that this is camel cased.

[JsonProperty("tId")]
public string TId { get; set; }

How can I combine these into one?

Upvotes: 0

Views: 1155

Answers (1)

Sergey Prosin
Sergey Prosin

Reputation: 711

[JsonProperty(PropertyName = "tId", NullValueHandling = NullValueHandling.Ignore)]
public string TId { get; set; }

Upvotes: 5

Related Questions