Questions tagged [ninject-conventions]

Ninject Conventions is a Ninject Extension that helps to reduce binding configuration code by implementing configuration by convention.

Ninject Conventions is a Ninject Extension that helps to reduce the amount of binding configuration lines of code necessary when binding dependencies.

It provides a fluent means of implementing configuration by convention by allowing you to identify groups of components that require identical binding configuration, and specify the configuration in a single statement.

22 questions
0
votes
1 answer

Multiple Ninject Modules giving odd behaviour

This one is a little complex but reproducible in my environment. Architecture as follows; BindingsLayer +-NinjectBindingsModule +-NinjectWebBindingsModule ContractsLayer +- ISomeService +- IAnotherService DomainLayer +-…
DiskJunky
  • 4,750
  • 3
  • 37
  • 66
0
votes
1 answer

Ninject: instantiate a service during configuration

I want to configure my ninject container using conventions AND create instances of all selected services at the same time. My current solution is: var singletons = new List(); kernel.Bind(x => x.FromThisAssembly()…
THX-1138
  • 21,316
  • 26
  • 96
  • 160
0
votes
1 answer

Is there an OOB way in Ninject to configure service in singleton scope?

I am using ninject with ninject.extenions.conventions. I would like to use a convention to initialize some services as singletons. I know it is straightforward to add a SingletonAttribute and use it with .WithAttribute() during…
THX-1138
  • 21,316
  • 26
  • 96
  • 160
0
votes
0 answers

how can I do if many class inherit one interface with Ninject.Extensions.Conventions

In my item,there are multi class inherit one interface, and many interface like this. for example,class A|B|C inherit interface Ilog, class F|E|G inherit interface IData, and class H|I|J inherit IBase, and so on. now ,I want bind All Interface use…
robot.M
  • 1
  • 3
0
votes
1 answer

FromAssembliesMatching overwrites explicitly set bindings

Is there a way to combine a call to FromAssembliesMatching to set up most interfaces automatically and some explicit bindings? I have the following code that should set all ISomething to Something automatically, and then set up a specific…
Imar Spaanjaars
  • 307
  • 1
  • 7
0
votes
1 answer

How to correctly bind types by convention?

The projects is planned to target multiplatform, so I pull the maximum of code in class libraries so that it can be easily reused. The architecture is based on the Model-View-Presenter principle. The project structure is the following: Solution …
Will Marcouiller
  • 23,773
  • 22
  • 96
  • 162
0
votes
0 answers

Fixing memory leak of EF4.1 context + Ninject combo

I have a windows service which periodically runs some jobs using NCron. I recently introduced Ninject and got some serious memory issues due to the fact that the EF context (ObjectContext from EF4.1) is not GC'ed (I memory-profiled it). It might be…
1
2