You have to use conditional bindings e.g
Bind<IRepository>().To<Repository>().WhenInjectedInto<CachedRopsitory>();
Bind<IRepository>().To<CachedRepository>().WhenInjectedInto<CachedLoggedRepository>();
Bind<IRepository>().To<CachedLoggedRepository>();
More Related Contents:
- What is Component-Driven Development?
- Where should I do Injection with Ninject 2+ (and how do I arrange my Modules?)
- MEF vs. any IoC
- Is it possible to bind different interfaces to the same instance of a class implementing all of them?
- Arguments against Inversion of Control containers
- Abstract factory pattern on top of IoC?
- What is a JavaBean exactly?
- Ioc/DI – Why do I have to reference all layers/assemblies in application’s entry point?
- Why not use an IoC container to resolve dependencies for entities/business objects?
- How to get method parameter names?
- Using IoC for Unit Testing
- Factory method with DI and IoC
- Use Cases and Examples of GoF Decorator Pattern for IO
- When to Use the Decorator Pattern?
- How can I implement Ninject or DI on asp.net Web Forms?
- ASP.NET MVC Routing Via Method Attributes [closed]
- Creating an instance using Ninject with additional parameters in the constructor
- An object with the same key already exists in the ObjectStateManager. The ObjectStateManager cannot track multiple objects with the same key
- Is there a good/proper way of solving the dependency injection loop problem in the ASP.NET MVC ContactsManager tutorial?
- Do I need dependency injection in NodeJS, or how to deal with …?
- What are some common uses for Python decorators? [closed]
- Experimental decorators warning in TypeScript compilation
- Using Simple Injector with Unit Of Work & Repository Pattern in Windows Form
- IoC / Dependency Injection – please explain code versus XML
- Why is IoC / DI not common in Python?
- Python decorator as a staticmethod
- Is it possible to decorate include(…) in django urls with login_required?
- Generating dictionary keys on the fly [duplicate]
- Applying a decorator to every method in a class?
- Decorator error: NoneType object is not callable