C
C#3y ago
pox

Return a custom ProblemDetails from a controller. How should I do it?

There is BaseController.Problem but that creates a new problem details with some defaults.
Should I just do something like
return new ObjectResult(details)
{
ContentTypes = { "application/problem+json" },
StatusCode = details.Status,
};
return new ObjectResult(details)
{
ContentTypes = { "application/problem+json" },
StatusCode = details.Status,
};
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?