This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
Should we standardize on the use MediaTypeHeaderValue in ActionResults? #2411
Closed
Description
We have seemingly different ways to specify ContentType \ Encoding in various ActionResults:
ObjectResult
usesMediaTypeHeaderValue
https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNet.Mvc.Core/ActionResults/ObjectResult.cs#L32 👍FileResult
allows specifyingContentType
but not encoding (https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNet.Mvc.Core/ActionResults/FileResult.cs#L32)ContentResult
allows specifyingContentType
andEncoding
separately - https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNet.Mvc.Core/ActionResults/ContentResult.cs#L16-L18ViewResult
\PartialViewResult
allows specifying neither (Need a way to specify ContentType in ViewResult \ PartialViewResult #2408)
Might be more types here that I haven't looked at.