File tree Expand file tree Collapse file tree 2 files changed +23
-11
lines changed
Expand file tree Collapse file tree 2 files changed +23
-11
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ public class InjectionSingletonLifetimeManager : ContainerControlledLifetimeMana
88 #region Fields
99
1010 private readonly ILifetimeContainer _container ;
11- private bool _disposed ;
1211
1312 #endregion
1413
@@ -30,23 +29,24 @@ public InjectionSingletonLifetimeManager(ILifetimeContainer container)
3029 protected override void SynchronizedSetValue ( object newValue , ILifetimeContainer container )
3130 {
3231 base . SynchronizedSetValue ( newValue , container ) ;
33- if ( newValue is IDisposable ) _container . Add ( new DisposableAction ( ( ) =>
34- {
35- RemoveValue ( _container ) ;
36- _disposed = true ;
37- } ) ) ;
32+ if ( newValue is IDisposable ) _container . Add ( new DisposableAction ( ( ) => RemoveValue ( _container ) ) ) ;
3833 }
3934
4035 protected override LifetimeManager OnCreateLifetimeManager ( )
4136 {
4237 return new InjectionSingletonLifetimeManager ( _container ) ;
4338 }
4439
45- public override void RemoveValue ( ILifetimeContainer container = null )
46- {
47- _disposed = true ;
48- base . RemoveValue ( container ) ;
49- }
40+ #endregion
41+
42+
43+ #region Overrides
44+
45+ /// <summary>
46+ /// This method provides human readable representation of the lifetime
47+ /// </summary>
48+ /// <returns>Name of the lifetime</returns>
49+ public override string ToString ( ) => "Lifetime:InjectionPerContainer" ;
5050
5151 #endregion
5252
Original file line number Diff line number Diff line change @@ -25,5 +25,17 @@ public override bool InUse
2525 get => false ;
2626 set { }
2727 }
28+
29+
30+
31+ #region Overrides
32+
33+ /// <summary>
34+ /// This method provides human readable representation of the lifetime
35+ /// </summary>
36+ /// <returns>Name of the lifetime</returns>
37+ public override string ToString ( ) => "Lifetime:InjectionTransient" ;
38+
39+ #endregion
2840 }
2941}
You can’t perform that action at this time.
0 commit comments