You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When migrating from 3.3 to 4.1.3.0 this did have a compatibility impact. A custom LifetimeManager of mine returned null when no value was stored yet. This caused Unity to create a value and store it. Subsequent gets returned that value. Now the initial return null; causes null to be stored.
Without the ?? LifetimeManager.NoValue which is the fix.
I believe types deriving from SynchronizedLifetimeManager are not affected because there is special handling for null and NoValue there. My type derived directly from LifetimeManager.
I have fixed this by using the new NoValue. Notifying you of this because this might break other users. Was it not the standard pattern before to have this dance of 1. return null 2. container creates value 3. value is stored 4. get now returns stored value? This pattern is now broken.
Description
Current implementation does not recognize NULL as valid object.
Problem
A lot of times NULL is a valid value for the dependency created by a Factory or registered as an instance.
Solution
Add NULL as a first class citizen to Unity system.
Impact
Existing code should not be impacted.
The text was updated successfully, but these errors were encountered: