Skip to content
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.

ValueTask<T> response body is serializing ValueTask instead of T #6040

Closed
@redknightlois

Description

@redknightlois

I recently upgraded a CoreCLR 1.1 codebase to C# 7.0 and tried to change the output of async controllers to diminish allocation pressure from Task<T> to ValueTask<T>. However the output of MVC is serializing ValueTask<T> instead of T

The response was supposed to be:

[
  {
    "code": "code",
    "displayName": "Coding"
  }
]

But when changed to ValueTask it ends up being:

{
  "isCompleted": false,
  "isCompletedSuccessfully": false,
  "isFaulted": false,
  "isCanceled": false,
  "result": {
    "value": [
      {
        "code": "code",
        "displayName": "Coding"
      }
    ],
    "formatters": [],
    "contentTypes": [],
    "declaredType": null,
    "statusCode": 200
  }
}

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions