While following along with Scott Allen's Pluralsight course, "Asp.net Core 1.0 Fundamentals", in the "Controllers in the MVC Framework" module and "Action Results" section I ran into a 406 Not Acceptable error on my Index action method that returned an ObjectResult with a model object.
This blog post led me to making a reference to the IMvcCoreBuilder and adding the JSON formatter as follows:
public void ConfigureServices(IServiceCollection services)
{
var mvcCore = services.AddMvcCore();
mvcCore.AddJsonFormatters();
services.AddSingleton(provider => Configuration);
services.AddSingleton<IGreeter, Greeter>();
}
which allowed me to continue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With