aspnet/Mvc — pull request #1029 by sornaks (2014-08-18 21:44:01+00:00)
Title: Issue #1017: Making "type" an argument in ObjectResult's constructor.

...redType is always set when Serializing the output.

Serializing cannot use RuntimeType because - There is a possibility where the output Object can be null in itself. The type cannot be determined in that case and Serializer cannot be created. In that case if DeclaredType is also null, then the Serializer will have no option but to throw. Adding the "type" to the constructor will make it more obvious for the developer to set that when creating an ObjectResult.
Added functional test to verify the case when both type and data is null.