title: How to get data frombody in a custom ModelBinder?
body: <p>I'm creating a custom implementation of IModelBinder in a .NET Core 1.1 (full framework) app.  </p>
  
  <p>I have a class <code>ActivityModel</code> that has an interface property:</p>
  
  <pre><code>public class ActivityModel
  {
      public int Id { get; set; }
      public string Title { get; set; }
      public int Type { get; set; }
      public IActivityContent Content { get; set; }    // marker interface  
      //more unimportant props
  }
  </code></pre>
  
  <p>The idea is that the client can send this object with a <code>Content</code> property that can be one of many (currently 8, but it may be growing) different classes.  </p>
  
  <p>This way we can have one endpoint in the API (for each CRUD operation) that can handle all of these different types of objects.  </p>
  
  <p>I'm in the process of implementing a ModelBinder to turn the object sent from the client into a concrete class, and here's what I've got so far:</p>
  
  <pre><code>    public Task BindModelAsync(ModelBindingContext bindingContext)
      {
          if (bindingContext == null)
          {
              throw new ArgumentNullException(nameof(bindingContext));
          }
          var content = bindingContext.ValueProvider.GetValue("content");
  
          return TaskCache.CompletedTask;
      }
  </code></pre>
  
  <p>I'm currently just trying to get the Content object into a variable so I can work with it more, but ValueProvider only has RouteValueProvider and QueryStringValueProvider.  How do I get the body data in here? </p>