Thanks Martin, but is it possible to seralize my contract in JSON
In D365fo, I have this contract :
[DataContractAttribute('InputContract')]
class InputContract
{
str myValue;
[DataMemberAttribute('MyValue')]
str parmMyValue(str _myValue = myValue)
{
myValue = _myValue;
return myValue;
}
}
In my project C#, I created a similar contract :
public class InputContract
{
public int MyValue { get; set; }
}
How Can I do for serialize my C# contract for sending to D365fo ?
InputContract contract = new InputContract { MyValue = "Hello" };
request.Content = new StringContent(JsonConvert.SerializeObject(contract),
Encoding.UTF8,
"application/json");
This code does not work, I think that I have to do something in addition.