I have a binding of an interface to a concrete class thus
_ninjectKernal.Bind<IAuctionContext>().To<AuctionContext>()
What I want to do in my code is get the concrete class for the interface IAuctionContext. So I want to do something like this
IAuctionContext context = .GetBinding();
Where context will be of type AuctionContext.
Is this possible. I’ve done similar stuff with StructureMap in the past.
Note – If you are using dependency injection you should shy away from calling
Get( ... )in “Kernel” (orContainer.GetInstance( ... )in StructureMap) directly.