I am evaluating the configuration of a Web API App with Asp.Net Core 2. To configure I know it is better for my project to use .AddMvcCore()
rather then use AddMvc()
since I don't need Razor as we can see here.
Now, I am not sure if I also need this .AddFormatterMappings()
. So my question is what is it for?
You can see from the source code in the MVC GitHub repo that it adds a FormatFilter
service into the DI setup. The summary for the FormatFilter
class is as follows:
A filter that will use the format value in the route data or query string to set the content type on an
ObjectResult
returned from an action.
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