Force.com-Toolkit-for-NET
Force.com-Toolkit-for-NET copied to clipboard
Createable/Updateable attributes don't work on properties with a custom JsonProperty name
Example:
[Createable(false), Updateable(false)]
[JsonProperty("Salesforce_Name__c")]
public string DotnetName { get; set; }
The CreateableContractResolver and UpdateableContractResolver will not work in this case, since it's comparing the wrong property names. This can be fixed by replacing
var propInfo = type.GetRuntimeProperty(property.PropertyName);
with
var propInfo = type.GetRuntimeProperty(property.UnderlyingName);
in those two classes.