Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3234208
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:21:53+00:00 2026-05-17T17:21:53+00:00

my app has a lot of support tables that requires admin UI interface to

  • 0

my app has a lot of support tables that requires admin UI interface to maintain – for ex: Countries, States, Cities etc. I am not sure if it would make sense to add CRUD actions for each of them in one AdminController or create a Controller for each individual support table.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:21:53+00:00Added an answer on May 17, 2026 at 5:21 pm

    If your code is highly repetative and you’ve got the proper data layer abstractions in place (eg, repository pattern, dependency injection) you could create a generic admin controller and subtype it.

    public abstract class AdminController<T> : Controller
    {
       protected IRepository<T> _Repository;
    
       protected AdminController(IRepository<T> repo)
       {
           _Repository = repo;
       }
    
       public ViewResult List()
       {
           var all = _Repository.GetAll();  // todo paging, sorting, etc -- I'd use a service layer to do this
           return View(all);
       }
    
       public ViewResult Edit(int id)
       {
          var item = _Repository.GetById(id);
          return View(item);
       }
       // and so on...
    }
    

    Then the actual controllers:

    public class PostController : AdminController<Post>
    {
       public PostController(IRepository<Post> repo) : base(repo) {}
    }
    

    Of course you’ll still need to make all the views.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've inherited an AS2 app that has a lot of functionality. I need to
I'm working on an app that currently has a lot of ManyToMany relationships (and
i have just taken over an app that has a lot of code like
I'm working with spring 3.0.6. My app has lot of places where logging added
My app has several buttons which trigger different events. The user should NOT be
My app has some table cells that vary in height. The cells can also
My app has a common class that displays an actionSheet whenever Contact Us is
We have a mid-size SQL Server based application that has no indexes defined. Not
My app has a lot of different lookup values, these values don't ever change,
I have been support a web app that is used by a user base

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.