gnome
gnome

Reputation: 1133

ASP.NET MVC BaseController

I use a BaseController to wire up my service layer. All other controllers inherit this controller. Now I'm embarking on building an MVC2 project template. I would like controllers to inherit this by default, not just the ": Controller", but have no idea how to approach this.

Upvotes: 0

Views: 602

Answers (2)

Wyatt Barnett
Wyatt Barnett

Reputation: 15673

I'd note that if it is just to wire in a service layer, you might well be better served by using an IoC container (eg--structuremap) and dependency injection into otherwise unadulterated Controllers. Or, Composition > Inheritance any day.

Upvotes: 1

Related Questions