0

First off, here's the code:

Binding in the NinjectControllerFactory

class MrBigglesworthServices : NinjectModule
{
        public override void Load()
    {
        Bind<IAuthenticationRepository>()
            .To<AuthenticationRepository>()
            .WithConstructorArgument("connectionString",
                ConfigurationManager.ConnectionStrings["VoiceDB"].ConnectionString
                );

        Bind<IAppRepository>()
            .To<AppRepository>()
            .WithConstructorArgument("connectionString",
                ConfigurationManager.ConnectionStrings["SessionStore"].ConnectionString
                );
        }
    }

Constructor for the Search Controller:

private IAppRepository appRepository;

public SearchController(IAppRepository appRepository)
{
    this.appRepository = appRepository;
}

Based on what I've seen with online examples, this should be enough, but for some reason, it's bringing up the error mentioned above. Any suggestions? Please and thank you.

1 Answer 1

1

Because you mention using a NinjectControllerFactory I think you are using an incorrect implementation. Consider to switch to https://github.com/ninject/ninject.web.mvc/wiki/MVC3 instead. This is a widely used integration of Ninject and MVC3.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.