private void CreatePage() { ++_pagesCounter; Console.Out.WriteLine(""); Console.Out.WriteLine($"Creating page {_pagesCounter}"); var pageLifetime = _lifetime.CreateLifetime(); _pageFactory.Create(pageLifetime, $"Page{_pagesCounter}"); _lifetimes.Add(_pagesCounter, pageLifetime); }
// Creates a similar lifetime to use with generic instances public ILifetime CreateLifetime() => new MySingletonLifetime(_baseSingletonLifetime.CreateLifetime(), _counter);