Treat returned strings as content results.
This commit is contained in:
parent
1dcafe5df4
commit
b798736385
|
|
@ -20,6 +20,14 @@ namespace Microsoft.AspNet.Mvc
|
|||
return new HttpResponseMessageActionResult(responseMessage);
|
||||
}
|
||||
|
||||
if (actionReturnValue is string)
|
||||
{
|
||||
return new ContentResult
|
||||
{
|
||||
Content = (string)actionReturnValue
|
||||
};
|
||||
}
|
||||
|
||||
// all other object types are treated as an http response message action result
|
||||
var content = new ObjectContent(actionReturnValue.GetType(),
|
||||
actionReturnValue,
|
||||
|
|
|
|||
Loading…
Reference in New Issue