title: dynamically adding an array to a resource in run time
body: <p>I have a custom <code>ODataResourceSerializer</code> which under some conditions adds new properties to a resource, that works perfectly.</p>
  
  <p>I am trying to add a new simple int[] property</p>
  
  <p>the resource is a dynamic resource that is registered at runtime and does not have these properties on the model.</p>
  
  <p>this code</p>
  
  <pre><code>case TypeX tx:
  
    propertiesToReturn.Add(new ODataProperty()
       {
          Name = "TypeX",
          Value = new ODataCollectionValue()
          {
             Items = new int[] {1,2,3}
          }
       });
  </code></pre>
  
  <p>gives me whrn the resource is sent to the <code>ODataJsonLightPropertySerializer.WriteCollectionProperty</code></p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>and when trying to add the value directly to the odata property </p>
  
  <pre><code>new ODataProperty()
  {
      Value = new int[] { 1, 2, 3 }   
  }
  </code></pre>
  
  <p>I get on add </p>
  
  <blockquote>
    <p>An ODataPrimitiveValue was instantiated with a value of type 'System.Int32[]'. ODataPrimitiveValue can only wrap values which can be represented as primitive EDM types</p>
  </blockquote>
  
  <p>I tried adding int[] to the model builder
  I tried adding a type to the ODataCollectionValue</p>