How would I get the JSON PropertyName of the following class & Property? Something like a "nameof()" equivilent for JSON Properties?
ie, something like
var jsonName = GetJSONPropertyName(SampleClass.SampleClassID); //should return "jsoniD"
public class SampleClass
{
public SampleClass() { }
[JsonProperty(PropertyName = "jsoniD")]
public string SampleClassID { get; set; }
}
Aucun commentaire:
Enregistrer un commentaire