/// <summary> /// Adds to lifetime. /// </summary> /// <param name="instanceScope">The instance scope.</param> public void AddToLifetime(IAmALifetime instanceScope) { instanceScope.Add(this); if (_successor != null) { _successor.AddToLifetime(instanceScope); } }
/// <summary> /// Adds to lifetime. /// </summary> /// <param name="instanceScope">The instance scope.</param> public void AddToLifetime(IAmALifetime instanceScope) { if (this is IDisposable) { instanceScope.Add(this); } if (successor != null) { successor.AddToLifetime(instanceScope); } }
/// <summary> /// Adds to lifetime. /// </summary> /// <param name="instanceScope">The instance scope.</param> public void AddToLifetime(IAmALifetime instanceScope) { instanceScope.Add(this); _successor?.AddToLifetime(instanceScope); }