私は非常に単純な問題を抱えていますが、次の「最良の」解決策を探しています。
私は次のような複数のコントローラーアクションを持っています:
public ActionResult DoSomething(PackageViewModel packageByName, DoSomethingInputModel inputModel)
{
if (packageByName == null)
{
Response.StatusCode = 404;
Response.StatusDescription = "Package not found : " + RouteData.GetRequiredString("packageName");
return View("Error");
}
...
この横断的関心事を分離するための最良の方法は何ですか?
- 機能が作れる
- PostSharpのようなAOPツールを使用できます
- ActionFilter
- 他の?