ASP.NET Core Web API - Parameter binding does not work when member of a class is an Interface
<p>I have a method in my Web API Controller:</p>

<pre><code>[HttpPost]
public void Post([FromBody]Registration registration)
{
    // omitted
}
</code></pre>

<p>I am able to invoke the method but the parameter is always null. Registration class is defined as:</p>

<pre><code>public class Registration
{
    public int Id { get; set; }
    public IStudent Student { get; set; }
}

public interface IStudent
{
    string FirstName { get; set; }
    string LastName { get; set; }
}

public class Student : IStudent
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
}
</code></pre>

<p>It seems the Student property of Registration being an interface is what's causing this since when I try to replace it with a concrete type, it binds just fine.</p>

<p>How do I make this bind when using an interface? Also, on my original Web API, I am accepting a parameter of type Registration. Is it possible also to make this as an Interface (IRegistration) and still bind?</p>