I'm parsing metadata from an OData service using Microsoft.OData (ODataLib) version 7.
After parsing the ODataModel, I want to create an example message with sample values for all declared properties.
So far so good. Works for primitive values in the properties, or for enums and even collection values.
An example for a primitive value:
var property = new ODataProperty() {
Name = "Key",
Value = new ODataPrimitiveValue("Value")
};
I want to create a complex value like so:
var property = new ODataProperty() {
Name = "Key",
Value = new ODataComplexValue() {
Properties = new List<ODataProperty>() {
new ODataPrimitiveValue("Value")
}
}
};
However, ODataComplexValue does not exist in version 7 (latest NuGet Release).
I had a look at the github: the class is in the master branch, but not in the ODatav4-7.x branch.
https://github.com/OData/odata.net/tree/master/src/Microsoft.OData.Core
How can I create complex values?