📅  最后修改于: 2022-03-11 14:48:53.854000             🧑  作者: Mango
public class ErrorModel
{
public string Error { get; set; }
public int Id { get; set; }
public List Values { get; set; }
}
//filter
var error = new ErrorModel
{
Error = context.Exception.Message,
Id = 1,
Values = new List { 1, 2, 3 }
};
context.Result = new ObjectResult(error)
{
StatusCode = 500
};