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 8266469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:10:25+00:00 2026-06-08T05:10:25+00:00

I have a very large (77 actions) controller that I am using to make

  • 0

I have a very large (77 actions) controller that I am using to make a site with wizard-like functionality. The site is like a “job application manager” with multiple components such as an admin component and an end-user component. The component I’m working with is the part where the user would actually fill out a job application. The way things are structured with the other components, it makes the most sense to put all of the job application stuff in the same controller. All of these actions perform similar things but on different models, like so:

public class ExampleController : Controller
{
    public ActionResult Action1() 
    {
        Guid appId = new Guid(Session["AppId"].ToString());
        ... // logic to pull up correct model
        return View(model)
    }

    [HttpPost]
    public ActionResult Action1(FormCollection formValues)
    {
        Guid appId = new Guid(Session["AppId"].ToString());
        ... // logic to update the model
        return RedirectToAction("Action2");
    }

    public ActionResult Action2()
    {
        Guid appId = new Guid(Session["AppId"].ToString());
        ... // logic to pull up the correct model
        return View(model)
    }

    ... // on and on and on for 74 more actions
}

Is there any way to reduce some of the constant redundancy that’s in every one of the actions? Here is what I am thinking:

  • Creating a member variable Guid to store the appId and then overriding OnActionExecuting to populate this variable. Is this a good idea?
  • Implementing some kind of paging to cut down on the number of actions. Any suggestions on how to do that?
  • 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-06-08T05:10:27+00:00Added an answer on June 8, 2026 at 5:10 am

    I would say yes to your first point and “it depends” to your second. Don’t change your design just because you have a lot of methods, if all 77 ActionResult methods make sense to have, then keep them around.

    Using a member variable and overriding OnActionExecuting seems like a great way to refactor that appID Guid code into a single place, so you can quickly and easily modify it in the future.

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

Sidebar

Related Questions

I have a very large set of permissions in my application that I represent
We have a client that is using CRM against a very large database. They
I have a Yii controller action that can potentially return a very large set
I have a very large ASP.NET application in C#. The issue is simple yet
I have a very large possible data set that I am trying to visualize
I have a very large XML file which has like 40000 data, and when
I have a very large list Suppose I do that (yeah, I know the
I have a Camera class that produces very large images at a high FPS
We have a very large GWT project that results in a monolithic app about
I have a structure (class) that keeps very large number of numbers (either float,

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.