比如这两种怎样更好
public ActionResult GetSomething()
{
return _service.GetSometing(); //<- 返回包装好的结果
}
public ActionResult Getsomething()
{
try
{
return Ok(_service.Getsomething());
}
catch (ExceptionA ea)
{
return BadRequset();
}
catch (ExceptionB eb)
{
return NotFound();
}
}
同理还有参数校验要放在哪里头整。。