私のデータベースにはテーブルがあります:
Products{ProductId, CategoryId, Name} // parent table
Procesors{ProductId...} // 1 to 1
HardDisks{ProductId...} // 1 to 1
MotherBoards{ProductId...} // 1 to 1
Categories{CategoryId, Name, ParentId}
そして、製品はprocesor, hard disk, mother board etc.
オプション1になります:
コントローラーを作成します
ProcesorControllers
HardDiskController
MotherBoardController
など。
オプション2:
CategoryController
ProductController
ProductController
方法はどこにありますか
public ActionResult Index(int categoryId, string category)
{... // return View(products);
アプリケーションシナリオでは、CRUD、フィルター製品が必要です