Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom middleware will not initialize #44

Open
miguelcastro67 opened this issue Jan 24, 2020 · 0 comments
Open

Custom middleware will not initialize #44

miguelcastro67 opened this issue Jan 24, 2020 · 0 comments

Comments

@miguelcastro67
Copy link

Hey everyone - can't seem to find a single thing on the web about this.
Everything setup correctly, controllers accept injection with no problem.
I have a middleware component with an additional constructor argument and when I add the app.builder.use to initialize it, I get an error about it only wanting a constructor with one argument. I tried property injection too with no joy. Basically, what is the exact procedure for ensuring middleware can accept injections?

Here's the Startup code - very simple. "container" is properly built and has everything registered into it.

        appBuilder.UseNinjectMiddleware(() => container);
        appBuilder.Use<LoggerMiddleware>(); // my custom middleware
        appBuilder.UseNinjectWebApi(config);

Anyone have any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant