Questions tagged [ninject-extensions]

Ninject Extensions are a collection of open-source projects designed to extend the functionality of the Ninject open-source dependency injector for the .NET framework.

Ninject Extensions are a collection of open-source projects designed to extend the functionality of the Ninject open-source dependency injector for the .NET framework.

Extension projects include, among others, those targeted at situations involving specific technologies such as MVC and WCF, as well as situations involving design patterns, such as Factories and Conventions.

207 questions
0
votes
2 answers

MVC2 & Ninject2 - Controllers not resolving dependency

I foolishly decided to try something new on a Friday job! So I have used NuGet to add Ninject.Web.Mvc 2.2.x.x to my .Net MVC2 project. I've altered my Global.asax.cs using System.Web.Mvc; using System.Web.Routing; using IntegraRecipients; using…
Paul D'Ambra
  • 7,629
  • 3
  • 51
  • 96
0
votes
1 answer

Adding reference to Ninject.Extensions.Interception.DynamicProxy causes Ambiguous Match Excpetion

I have Ninject configured to do DI in an ASP.NET MVC 3 application. This is working fine and it injects the proper classes in to my controllers. When I try and add Ninject.Extensions.Interception to work with my application I start getting an…
0
votes
0 answers

Ninject Factory with Injected Arguments

I'm trying to create a Ninject Factory using Ninject.Extensions.Factory like below: public interface ICommandBatchFactory { CommandBatch GetCommandBatch(ILogger logger); } The problem is that I need "logger" to be injected…
0
votes
2 answers

How to configure the Ninject bindings for this scenario?

I have a question about Ninject, but before going directly to the question, I will explain the general scenario. I have a Business interface called ITest__Business and its implementation Test__Business. This class depends on 3 interfaces:…
Marlonchosky
  • 494
  • 5
  • 16
0
votes
1 answer

Using Ninject, how can I use property injection, Lazy<>, and interception without encountering errors in castle.core?

I created a simple program as a PoC for an old SharePoint On-Prem project that uses ASP.NET Webforms. In its pages, I have to use property injection, and for everything else, I can use constructor injection. I am also…
0
votes
2 answers

Where is a singleton instance stored in ninject?

The title has it all. When I do this: var kernel = new StandardKernel(); kernel.Bind().To().InSingletonScope(); var myClass = kernel.Get(); Where is the instance of MyClass stored? Is it stored in a static dictionary…
0
votes
1 answer

Ninject register by convention with names

Is there a way to register with Ninject, using conventions, all classes that implement a certain interface, associated with each class' name? interface IClientCodeValidator { string ValidateClientCode(params IXpressionNode[] customParameters); …
bdaniel7
  • 197
  • 1
  • 10
0
votes
2 answers

How to use convention extension with complex initiation ( like: ToMethod )

example of convention extension kernel.Bind(x => { x.FromThisAssembly() .SelectAllClasses() .WithAttribute() .BindBase(); }); And each type which I get should be provide complex initiation with this method public…
0
votes
0 answers

Binding generic interface with multiple implementations in ninject

I have the following interface: public interface IQueryStringHelper where T : class where TQueryString : class { IQueryable ApplyQueryStringToQuery(IQueryable query, TQueryString queryString, out int count); } and its…
grimsan55
  • 265
  • 3
  • 4
  • 20
0
votes
2 answers

Dependency Injection with Ninject in Session_Start method of web form application

iam using ninject.web extension in my web application but now i have a problem reolving a dependence in Session_Start method of global.asax this is my global.asax public class Global : NinjectHttpApplication { [Inject] …
gt.guybrush
  • 1,320
  • 3
  • 19
  • 48
0
votes
1 answer

Ninject.Web.Mvc add-on not working with ASP.NET MVC 2

I'm using the Ninject.Web.Mvc (the MVC 2 version) add-on with ASP.NET MVC 2. This is an excerpt of my Global.asax.cs: protected override void OnApplicationStarted() { AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes; …
0
votes
0 answers

Null values passing on asp.net mvc 5 controller (Ninject DI)

I'm working on a MVC5 application and i'm trying to implement DI on my controller class. I have correctly put binding on Ninjectwebcommons. Still constructor of the controller class is receiving just null implementations. public class…
0
votes
1 answer

Bind interface to multiple concrete implementation with constructor argument

I am trying to do contextual binding but not able to bind concrete implementation interface as constructor argument. Ninject version: 3.2.0.0 My structure is as follows: INotifier 1. XNotifier 2. YNotifier IPublisher 1. APublisher 2.…
0
votes
2 answers

Creating a custom Ninject provider for multiple types implementing the same interface

I have an interface, let's say it's IDrawingTool. I have multiple classes implementing this interface, let's say PencilTool, PenTool, YellowMarkerTool, etc. I am usually binding more than one of these classes in Ninject, and I always access…
Eugene Osovetsky
  • 6,443
  • 2
  • 38
  • 59
0
votes
3 answers

Pass a dependency instance to a factory method parameter to make Ninject use it within the resolution

I have an abstract factory which creates some service represented by IService interface. In the factory I have two Create methods, because at one of them I allow the consumer to pass an existing IServiceLogger instance to be used by the constructed…
Zoltán Tamási
  • 12,249
  • 8
  • 65
  • 93