我正在尝试placeholders与我的 select salary,DEPARTMENT_ID from EMPLOYEES order by 1 fetch first 15 rows only;
合作。以下示例是正在进行的简化版本。
ValidationFailure
实际结果:
public IActionResult Get()
{
var errors = new List<ValidationFailure>();
errors.Add(new ValidationFailure("PropertyName", "{PropertyValue} is not a valid value.", 42));
var result = new ValidationResult(errors);
result.AddToModelState(ModelState, null);
return BadRequest(ModelState);
}
预期结果:
{
"PropertyName": [
"{PropertyValue} is not a valid value."
]
}
我可以在{
"PropertyName": [
"42 is not a valid value."
]
}
对象上看到这些方法。所以我想我只需要将它发送给正确的服务以使魔术发生:)
ValidationFailure
有什么建议吗?