ninject-1

Ninject OnePerRequestBehaviour doesn't seem to work correctly?

I've been using Ninject as my IOC in my web app. It's great and I think it works really well, however I have been trying to register some interfaces / classes as OnePerRequestBehaviour but it doesn't seem to actually use the behaviour. The code runs correctly but in one of my classes it lazy loads page information from the database then ...

Instantiation failure and singleton-behaviour interaction [NInject1]

I have set up a NInject (using version 1.5) binding like this: Bind<ISessionFactory>().ToMethod<ISessionFactory>(ctx => { try { // create session factory, might fail because of database issues like wrong connection string } catch (Exception e) { throw new DatabaseException(e); } }).Using<Singleto...

Binding an interface to 2 different concrete objects in ninject based on the method attribute

I have 2 different concrete objects, lets save ConcreteOne and ConcreteTwo. Each of these implement an interface ILooseyGoosey. I would like ninject to call a different method depending on the attribute on that method. This is what I have so far: public class ConcreteOne : ILooseyGoosey { public void SomeMethod() { }; } public class ...

How do I transfer configuration data into injected objects?

I used to use Spring.Net and want to switch to Ninject 1.5 (I have to use .NET2, since some unlucky guy like me still needs to consider users working with win 2k). I used to have everything done in xml and only invoke the container during startup. In this way, only very limited codes are depending on container. I have scenarios like this...