-
Notifications
You must be signed in to change notification settings - Fork 529
Changes in Ninject 4
As of Ninject 4 we only support the following target frameworks:
- .NET Framework 4.6 (and higher)
- .NET Standard 2.0
A major focus point for Ninject 4 is moving the needle for both performance and memory usage.
TODO Link to a benchark, and images showing the advancements.
- A StackOverflowException is thrown when type is a self-bindable, but the registered binding does not match (#341)
- Attempt to resolve an unbound generic type definition results in an IndexOutOfRangeException (#340
- Bind/Rebind to a constant List always returns an empty list (#333)
Even though injection into private members is generally considered to be a bad practice, Ninject has provide knobs to enable private constructor, method and property injection.
To encourage you to move away from private member injection, both the InjectNonPublic and InjectParentPrivateProperties properties on (I)NinjectSettings are marked obsolete as of this release.
Unless we receive strong user feedback to keep this feature, support for private member injection will be removed in the next major release.
A new PropertyInjection property on (I)NinjectSettings has been introduced to allow one to disable property injection.
For those using only constructor or method injection, disabling property injection yields a minor performance bump.
By default, property injection remains enabled.
A new MethodInjection property on (I)NinjectSettings has been introduced to allow one to disable method injection.
For those using only constructor or property injection, disabling property injection yields a minor performance bump.
By default, method injection remains enabled.
This section provides a list of (breaking) API changes that we introduced. These changes only affect extensibility authors.
Changed return value of IBindingResolver (and implementing classes) from IEnumerable<IBinding>
to ICollection<IBinding>
.
Changed return value of ISelector.SelectConstructorsForInjection(Type type)
(and implementing classes) from IEnumerable<ConstructorInfo>
to ConstructorInfo[]
.
The T Get<T>(string key, T defaultValue)
and void Set(string key, object value)
methods have been removed from INinjectSettings.
The GetBindings(Type service)
method now returns IBinding[]
instead of IEnumerable<IBinding>
.
The GetBindings(Type service)
method now returns IBinding[]
instead of IEnumerable<IBinding>
.
The GetBindings(Type service)
method now returns IBinding[]
instead of IEnumerable<IBinding>
.
Licensed under Apache 2 License
Contents
- Home
- Why Use Ninject
- Getting Started
- Dependency Injection By Hand
- Dependency Injection With Ninject
- Injection Patterns
- Multi Injection
- Object Scopes
- Modules and the Kernel
- Providers, Factory Methods and the Activation Context
- The Activation Process
- How Injection Works
- Contextual Binding
- Conventions-Based Binding