In classic ASP.NET Web Forms view engine, we can set the ContentType in the .aspx page to the desired type.
Is there a direct/recommended equivalent in Razor?
Use this:
return Content(json, "application/json");