Asp.net Core MVC JSONRESULT Contoh

public IActionResult ErrorJSON()
        {
            //return json with 400 error code with message
            return new JsonResult(new { message = "Error Messages" })
            {
                StatusCode = StatusCodes.Status400BadRequest // Status code here 
            };
        }
Mohamed Sami khiari