C
C#2y ago
linqisnice

❔ I'm building an MVC core webshop. How should I be structuring controllers, actions and views?

So, right now, I have one single view, and this view renders both information about the product and the catalog (using partial views). And for this view, I have one get and one post controller. Following PRG pattern btw. But my index get controller is kinda bloated, it has 6 parameters. On my main page you can choose between four categories. Mousing over them will show a dropdown list of "subcategories" (what I call product types) and brands. So category = things like PC Peripherals, ProductType = Mouse/Monitor whatever. The question I have, should Category/ProductType have its own controller? Or is it enough with its own action inside the catalogcontroller? How should I be thinking about this?
2 Replies
linqisnice
linqisnice2y ago
https://github.com/kennyolmez/GamifyWebShop code for controller and view can be found here
GitHub
GitHub - kennyolmez/GamifyWebShop: Light MVC Core webshop with pers...
Light MVC Core webshop with persistent shopping cart for both guests and authenticated users and order capabilities - GitHub - kennyolmez/GamifyWebShop: Light MVC Core webshop with persistent shopp...
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.