mrblah
mrblah

Reputation: 103707

Help with naming my admin related controllers

I can't come up with a nice name for my admin related controllers.

I have a UserController that is used for the site (non-admin related actions). Now I created an ADMIN section that has the following url format:

www.example.com/admin/{controller}/{action}/{id}

My controller folder is layed out like:

/controllers/ /controllers/admin/admincontroller /controllers/usercontroller

I need to make a controller for editing/deleting/listing users to perform admin related actions on them.

I will place this controller in my /controllers/admin/ folder just to keep them seperate.

What should I name this controller?

I don't want to do AdminUserController

As it just looks silly, any help!?

Upvotes: 1

Views: 255

Answers (3)

Dean Johnston
Dean Johnston

Reputation: 446

UserManagementController or perhaps ManageUserController or something else along those lines.

www.example.com/admin/UserManagement/{action}/{id} www.example.com/admin/ManageUser/{action}/{id}

Upvotes: 0

Andrew Song
Andrew Song

Reputation: 3128

AdminActionsController?

Is there a reason you don't want them inside your AdminController? All of these actions seem to fall under this category.

EDIT: What about EditController then?

Upvotes: 1

veggerby
veggerby

Reputation: 9020

You could put them in an YourProject.Controllers.Admin namespace.

Alternatively if it is just for "url" purposes, you could create specific routes for these controllers, i.e.

routes.MapRoute("/admin/users/{action}/{id}", new { controller = "AdminUser" });

Upvotes: 2

Related Questions