Q. 1 I'm trying to push an entity into CRM. The json looks like this:
{
"sub_AssignedToCompanyId@odata.bind": "/accounts(f52f9dd7-35e5-e711-813b-480fcff40721)"
}
Now, my C# class has a property on it called AssignedToCompany, looks like this:
[JsonProperty(PropertyName = "sub_AssignedToCompanyId@odata.bind")]
public int AssignedToCompany{ get; set; }
What I want is a way to serialize it to sub_AssignedToCompanyId@odata.bind (which i've done using JsonProperty("sub_AssignedToCompanyId@odata.bind"). But then the swagger definition doesn't look good. I want the swagger definition of this property to say "assignedToCompanyId". Is there anyway to do this? I'm using .Net Framework Web API.
Q.2 And, is there a way that I can translate this input: f52f9dd7-35e5-e711-813b-480fcff40721
to this output: /accounts(f52f9dd7-35e5-e711-813b-480fcff40721)
automatically during serialization?