How to rewrite BadRequest and Ok in .net web api?

mc 1,921 Reputation points
2023-05-23T10:20:33.7233333+00:00

How to rewrite

Ok

and BadRequest I can custom the return object?

if I return Ok(myObj) I want to add some property to myObj and If I return BadRequest I want to change the statusCode

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
3,121 questions
{count} votes