現在、私の Web サイトには、仕様パターンを含むリポジトリ パターンがあります。ほんの数行のコードで、.aspx ページ内からデータを取得できます。次に例を示します。
private IRepository repository;
protected void Page_Load(object sender, EventArgs e)
{
repository = new GenericRepository();
Specification<Book> specification = new Specification<Book>(b => b.Year == 1988);
lvBooks.DataSource = repository.GetAll<Book>(specification);
lvBooks.DataBind();
}
私の質問は、私の Web サイトにビジネス層が必要ですか? 答えが「はい」の場合、その理由は? 現時点では、仕様パターンのために、ページとリポジトリの間にあるビジネス層は必要ないようです。
ご意見ありがとうございます。