Alex Rivera | Logout

What are good candidates for base controller class in ASP.NET MVC?

Asked 2011-05-25T03:25:48.277
27

I've seen a lot of people talk about using base controllers in their ASP.NET MVC projects. The typical examples I've seen do this for logging or maybe CRUD scaffolding. What are some other good uses of a base controller class?

Edit
Report

1 Answer

10

I like to use base controller for the authorization.

Instead of decorating each action with "Authorize" attribute, I do authorization in the base controller. Authorized actions list is fetched from database for the logged in user.

please read below link for more information about authorization. Good practice to do common authorization in a custom controller factory?

answered 2011-05-25T18:58:28.100

Your Answer