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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:19:03+00:00 2026-05-27T10:19:03+00:00

I was looking over the Ninject MVC source code, and the method that generates

  • 0

I was looking over the Ninject MVC source code, and the method that generates a controller factory for overwriting the default is hardcoded to only return a NinjectControllerFactory, however as its set as virtual it would make more sense (in my eyes) to use an IControllerFactory.

/// <summary>
/// Creates the controller factory that is used to create the controllers.
/// </summary>
/// <returns>The created controller factory.</returns>
protected virtual NinjectControllerFactory CreateControllerFactory()
{
    return new NinjectControllerFactory(this.Kernel);
}

I love Ninject and I am sure there is a reason why it was done this way, but have a problem at the moment where I need to write my own ControllerFactory and use that, but would rather still use the NinjectHttpApplication. I know I could just inherit from NinjectControllerFactory and then override the method to return this new instance, but I would not be using any functionality from the Ninject flavour so it just seems that it would be a bit of a smell…

So is there a reason why it doesn’t use IController or is this something that may be changed in the new version?

  • 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-27T10:19:03+00:00Added an answer on May 27, 2026 at 10:19 am

    I assume that you are refering either to MVC 1.0 or 2.0. MVC 3.0 takes a completely different way.

    No there is no reason for not returning an IControllerFactory. This was most likely just an automatic refactoring and was not recognized. On the other hand if you are not using the NinjectControllerFactory there is almost no reason to use the extension at all.

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

Sidebar

Related Questions

From looking over the documentation, it seems that the form clean() method is only
I was looking over the JavaScript source code for SlickGrid . I've noticed that
I was looking over the js source code for Scrabb.ly . I've noticed that
I am looking over someone Else's code and noticed that some of the user
I am looking over some code that has heavy use of Java's instanceof operator.
I was looking over some code that another developer wrote and found this: Private
I'm looking over some code and I came across some syntax that I don't
I'm looking over the ui.dialog source code, which is probably the best learning experience
While looking over some code, I found a function that seems to do exactly
I was looking over some ASP.NET MVC 1 code (C#) in search of the

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.