示例
return Results.BadRequest(new { error = "Incorrect Product Id" });
return Results.Ok(new { message = "Product Deleted" } );
return Results.ValidationProblem(new Dictionary<string, string[]>
{
{ "id", new string[] { "Incorrect Product Id"} },
{ "test", new string[] { "test"} }
});
Gitee获取源码: