I have a custom ODataResourceSerializer
which under some conditions adds new properties to a resource, that works perfectly.
I am trying to add a new simple int[] property
the resource is a dynamic resource that is registered at runtime and does not have these properties on the model.
this code
case TypeX tx:
propertiesToReturn.Add(new ODataProperty()
{
Name = "TypeX",
Value = new ODataCollectionValue()
{
Items = new int[] {1,2,3}
}
});
gives me whrn the resource is sent to the ODataJsonLightPropertySerializer.WriteCollectionProperty
A type named 'System.Int32[]' could not be resolved by the model. When a model is available, each type name must resolve to a valid type.
and when trying to add the value directly to the odata property
new ODataProperty()
{
Value = new int[] { 1, 2, 3 }
}
I get on add
An ODataPrimitiveValue was instantiated with a value of type 'System.Int32[]'. ODataPrimitiveValue can only wrap values which can be represented as primitive EDM types
I tried adding int[] to the model builder I tried adding a type to the ODataCollectionValue