How to post list of interface objects into ASP.NET WebApi Action?
<p>Is it possible to post a model containing a list of interface objects into an WebApi controller action?</p>

<p>When I do it as follows my model is not null but the property "Items" contains no entries.</p>

<p>Here is my code:</p>

<p><strong>Controller.js</strong></p>

<pre><code>public void Post(MyModel model)
{
   ...
}
</code></pre>

<p><strong>MyModel.cs</strong></p>

<pre><code>public class MyModel
{      
    public int Id { get; set; }
    public string Name { get; set; }
    public IEnumerable&lt;IItem&gt; Items { get; set; }
}
</code></pre>

<p><strong>IItem.cs</strong></p>

<pre><code>public interface IItem
{
    string Test1 { get; set; }
    string Test2 { get; set; }
}
</code></pre>

<p><strong>Item.cs</strong></p>

<pre><code>public class Item : IItem
{
    public string Test1 { get; set; }
    public string Test2 { get; set; }
}
</code></pre>

<p>I think it is possible with a custom model binder, but I don't find a suitable example.</p>