我试图压制代码中的错误,但MVC操作仍然会返回" 500内部服务器错误"。
操作返回后,ASP.NET Boilerplate框架中会触发哪些事件?
public async Task<IActionResult> Post([FromBody]PaymentViewModel model)
{
var result = false;
// Storing of card must pass
try
{
// ...
}
catch (Exception ex)
{
// Catch business exception, but storing
}
return Json(new { result });
}
答案 0 :(得分:1)
要在Private Sub Button1_Click(sender As Object, e As PaintEventArgs) Handles Startpage.Button1.Click
End Sub
块中恢复,请使用catch
开始UnitOfWork
:
RequiresNew