From 87dc39e7b21257e89359c7d8dab10bf28199cd9b Mon Sep 17 00:00:00 2001 From: Nikolay Pianikov Date: Thu, 28 Nov 2024 17:20:44 +0300 Subject: [PATCH] Update README.md --- README.md | 8 +++++ readme/ReadmeTemplate.md | 8 +++++ readme/SingletonDetails.md | 18 +++++------ readme/accumulators.md | 24 +++++++------- readme/async-disposable-scope.md | 16 +++++----- readme/async-disposable-singleton.md | 16 +++++----- readme/auto-scoped.md | 10 +++--- readme/bind-attribute-for-a-generic-type.md | 10 +++--- .../bind-attribute-with-lifetime-and-tag.md | 8 ++--- readme/bind-attribute.md | 10 +++--- readme/complex-generics.md | 14 ++++---- .../default-lifetime-for-a-type-and-a-tag.md | 18 +++++------ readme/default-lifetime-for-a-type.md | 10 +++--- readme/default-lifetime.md | 16 +++++----- readme/disposable-singleton.md | 14 ++++---- readme/exposed-generic-roots-with-args.md | 10 +++--- readme/exposed-generic-roots.md | 10 +++--- readme/exposed-roots-with-tags.md | 10 +++--- readme/exposed-roots.md | 10 +++--- readme/func-with-arguments.md | 10 +++--- readme/keyed-service-provider.md | 18 +++++------ readme/onnewinstance-hint.md | 16 +++++----- readme/perblock.md | 14 ++++---- readme/perresolve.md | 26 +++++++-------- readme/root-binding.md | 10 +++--- readme/scope.md | 14 ++++---- readme/service-collection.md | 18 +++++------ readme/service-provider-with-scope.md | 30 ++++++++--------- readme/service-provider.md | 18 +++++------ readme/singleton.md | 10 +++--- readme/tag-type.md | 18 +++++------ readme/tags.md | 18 +++++------ readme/threadsafe-hint.md | 8 ++--- ...async-disposable-instances-in-delegates.md | 12 +++---- ...osable-instances-per-a-composition-root.md | 8 ++--- ...cking-disposable-instances-in-delegates.md | 12 +++---- ...osable-instances-per-a-composition-root.md | 8 ++--- ...sable-instances-using-pre-built-classes.md | 32 +++++++++---------- ...able-instances-with-different-lifetimes.md | 32 +++++++++---------- 39 files changed, 294 insertions(+), 278 deletions(-) diff --git a/README.md b/README.md index ad40b065f..43ae9a718 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,14 @@ DI.Setup(nameof(Composition)) > [!NOTE] > In fact, the `Bind().As(Singleton).To()` binding is unnecessary since _Pure.DI_ supports many .NET BCL types out of the box, including [Random](https://github.com/DevTeam/Pure.DI/blob/27a1ccd604b2fdd55f6bfec01c24c86428ddfdcb/src/Pure.DI.Core/Features/Default.g.cs#L289). It was added just for the example of using the _Singleton_ lifetime. +The Pure.DI source code generator works like this: + +```mermaid +flowchart TD + analyzing[Analyzing DI setups] --> types["`Types analysis + constructors/methods/properties/fields`"] --> deps[Creating a dependency graph] --> verification[Dependency graph verification] --> codeGeneration[Code generation] +``` + The above code specifies the generation of a partial class named *__Composition__*, this name is defined in the `DI.Setup(nameof(Composition))` call. This class contains a *__Root__* property that returns a graph of objects with an object of type *__Program__* as the root. The type and name of the property is defined by calling `Root("Root")`. The code of the generated class looks as follows: ```c# diff --git a/readme/ReadmeTemplate.md b/readme/ReadmeTemplate.md index 61cdff148..bc22b5cd5 100644 --- a/readme/ReadmeTemplate.md +++ b/readme/ReadmeTemplate.md @@ -62,6 +62,14 @@ DI.Setup(nameof(Composition)) > [!NOTE] > In fact, the `Bind().As(Singleton).To()` binding is unnecessary since _Pure.DI_ supports many .NET BCL types out of the box, including [Random](https://github.com/DevTeam/Pure.DI/blob/27a1ccd604b2fdd55f6bfec01c24c86428ddfdcb/src/Pure.DI.Core/Features/Default.g.cs#L289). It was added just for the example of using the _Singleton_ lifetime. +The Pure.DI source code generator works like this: + +```mermaid +flowchart TD + analyzing[Analyzing DI setups] --> types["`Types analysis + constructors/methods/properties/fields`"] --> deps[Creating a dependency graph] --> verification[Dependency graph verification] --> codeGeneration[Code generation] +``` + The above code specifies the generation of a partial class named *__Composition__*, this name is defined in the `DI.Setup(nameof(Composition))` call. This class contains a *__Root__* property that returns a graph of objects with an object of type *__Program__* as the root. The type and name of the property is defined by calling `Root("Root")`. The code of the generated class looks as follows: ```c# diff --git a/readme/SingletonDetails.md b/readme/SingletonDetails.md index 32fd8351b..7804c380e 100644 --- a/readme/SingletonDetails.md +++ b/readme/SingletonDetails.md @@ -60,8 +60,8 @@ partial class Singleton { private readonly Singleton _root; - private Service1? _scopedService139; - private Service4? _scopedService442; + private Service1? _scopedService141; + private Service4? _scopedService444; [OrdinalAttribute(20)] public Singleton() @@ -77,22 +77,22 @@ partial class Singleton [MethodImpl(MethodImplOptions.AggressiveInlining)] public partial CompositionRoot TestPureDIByCR() { - if (_scopedService442 is null) + if (_scopedService444 is null) { - _scopedService442 = new Service4(); + _scopedService444 = new Service4(); } - if (_scopedService139 is null) + if (_scopedService141 is null) { - if (_scopedService442 is null) + if (_scopedService444 is null) { - _scopedService442 = new Service4(); + _scopedService444 = new Service4(); } - _scopedService139 = new Service1(new Service2(new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!))); + _scopedService141 = new Service1(new Service2(new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!))); } - return new CompositionRoot(_scopedService139!, new Service2(new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!)), new Service2(new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!)), new Service2(new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!)), new Service3(_scopedService442!, _scopedService442!), _scopedService442!, _scopedService442!); + return new CompositionRoot(_scopedService141!, new Service2(new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!)), new Service2(new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!)), new Service2(new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!), new Service3(_scopedService444!, _scopedService444!)), new Service3(_scopedService444!, _scopedService444!), _scopedService444!, _scopedService444!); } [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/readme/accumulators.md b/readme/accumulators.md index 483220c19..ce3a9af65 100644 --- a/readme/accumulators.md +++ b/readme/accumulators.md @@ -49,7 +49,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private XyzDependency? _singletonXyzDependency43; + private XyzDependency? _singletonXyzDependency45; [OrdinalAttribute(20)] public Composition() @@ -69,19 +69,19 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - var accumulator46 = new MyAccumulator(); + var accumulator48 = new MyAccumulator(); AbcDependency perBlockAbcDependency4 = new AbcDependency(); - if (_root._singletonXyzDependency43 is null) + if (_root._singletonXyzDependency45 is null) { using (_lock.EnterScope()) { - if (_root._singletonXyzDependency43 is null) + if (_root._singletonXyzDependency45 is null) { - XyzDependency _singletonXyzDependency43Temp; - _singletonXyzDependency43Temp = new XyzDependency(); - accumulator46.Add(_singletonXyzDependency43Temp); + XyzDependency _singletonXyzDependency45Temp; + _singletonXyzDependency45Temp = new XyzDependency(); + accumulator48.Add(_singletonXyzDependency45Temp); Thread.MemoryBarrier(); - _root._singletonXyzDependency43 = _singletonXyzDependency43Temp; + _root._singletonXyzDependency45 = _singletonXyzDependency45Temp; } } } @@ -89,14 +89,14 @@ partial class Composition AbcDependency transientAbcDependency3 = new AbcDependency(); using (_lock.EnterScope()) { - accumulator46.Add(transientAbcDependency3); + accumulator48.Add(transientAbcDependency3); } - Service transientService1 = new Service(transientAbcDependency3, _root._singletonXyzDependency43!, perBlockAbcDependency4); + Service transientService1 = new Service(transientAbcDependency3, _root._singletonXyzDependency45!, perBlockAbcDependency4); using (_lock.EnterScope()) { - accumulator46.Add(transientService1); + accumulator48.Add(transientService1); } - return (transientService1, accumulator46); + return (transientService1, accumulator48); } } diff --git a/readme/async-disposable-scope.md b/readme/async-disposable-scope.md index 4bf3a035f..0e4154e6b 100644 --- a/readme/async-disposable-scope.md +++ b/readme/async-disposable-scope.md @@ -93,7 +93,7 @@ partial class Composition: IDisposable, IAsyncDisposable private object[] _disposables; private int _disposeIndex; - private Dependency? _scopedDependency41; + private Dependency? _scopedDependency43; [OrdinalAttribute(20)] public Composition() @@ -115,19 +115,19 @@ partial class Composition: IDisposable, IAsyncDisposable [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_scopedDependency41 is null) + if (_scopedDependency43 is null) { using (_lock.EnterScope()) { - if (_scopedDependency41 is null) + if (_scopedDependency43 is null) { - _scopedDependency41 = new Dependency(); - _disposables[_disposeIndex++] = _scopedDependency41; + _scopedDependency43 = new Dependency(); + _disposables[_disposeIndex++] = _scopedDependency43; } } } - return new Service(_scopedDependency41!); + return new Service(_scopedDependency43!); } } @@ -156,7 +156,7 @@ partial class Composition: IDisposable, IAsyncDisposable _disposeIndex = 0; disposables = _disposables; _disposables = new object[1]; - _scopedDependency41 = null; + _scopedDependency43 = null; } while (disposeIndex-- > 0) @@ -194,7 +194,7 @@ partial class Composition: IDisposable, IAsyncDisposable _disposeIndex = 0; disposables = _disposables; _disposables = new object[1]; - _scopedDependency41 = null; + _scopedDependency43 = null; } finally { diff --git a/readme/async-disposable-singleton.md b/readme/async-disposable-singleton.md index 9388bcc4e..ad65f3321 100644 --- a/readme/async-disposable-singleton.md +++ b/readme/async-disposable-singleton.md @@ -59,7 +59,7 @@ partial class Composition: IDisposable, IAsyncDisposable private object[] _disposables; private int _disposeIndex; - private Dependency? _singletonDependency41; + private Dependency? _singletonDependency43; [OrdinalAttribute(20)] public Composition() @@ -81,19 +81,19 @@ partial class Composition: IDisposable, IAsyncDisposable [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - _root._singletonDependency41 = new Dependency(); - _root._disposables[_root._disposeIndex++] = _root._singletonDependency41; + _root._singletonDependency43 = new Dependency(); + _root._disposables[_root._disposeIndex++] = _root._singletonDependency43; } } } - return new Service(_root._singletonDependency41!); + return new Service(_root._singletonDependency43!); } } @@ -107,7 +107,7 @@ partial class Composition: IDisposable, IAsyncDisposable _disposeIndex = 0; disposables = _disposables; _disposables = new object[1]; - _singletonDependency41 = null; + _singletonDependency43 = null; } while (disposeIndex-- > 0) @@ -145,7 +145,7 @@ partial class Composition: IDisposable, IAsyncDisposable _disposeIndex = 0; disposables = _disposables; _disposables = new object[1]; - _singletonDependency41 = null; + _singletonDependency43 = null; } finally { diff --git a/readme/auto-scoped.md b/readme/auto-scoped.md index bb9973715..a573d3498 100644 --- a/readme/auto-scoped.md +++ b/readme/auto-scoped.md @@ -75,7 +75,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Dependency? _scopedDependency41; + private Dependency? _scopedDependency43; [OrdinalAttribute(20)] public Composition() @@ -116,18 +116,18 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_scopedDependency41 is null) + if (_scopedDependency43 is null) { using (_lock.EnterScope()) { - if (_scopedDependency41 is null) + if (_scopedDependency43 is null) { - _scopedDependency41 = new Dependency(); + _scopedDependency43 = new Dependency(); } } } - return new Service(_scopedDependency41!); + return new Service(_scopedDependency43!); } } } diff --git a/readme/bind-attribute-for-a-generic-type.md b/readme/bind-attribute-for-a-generic-type.md index c9d2955c4..cab8273dd 100644 --- a/readme/bind-attribute-for-a-generic-type.md +++ b/readme/bind-attribute-for-a-generic-type.md @@ -52,7 +52,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Facade? _singletonFacade41; + private Facade? _singletonFacade43; [OrdinalAttribute(20)] public Composition() @@ -72,19 +72,19 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonFacade41 is null) + if (_root._singletonFacade43 is null) { using (_lock.EnterScope()) { - if (_root._singletonFacade41 is null) + if (_root._singletonFacade43 is null) { - _root._singletonFacade41 = new Facade(); + _root._singletonFacade43 = new Facade(); } } } IDependency transientIDependency1; - Facade localInstance_1182D12736 = _root._singletonFacade41!; + Facade localInstance_1182D12736 = _root._singletonFacade43!; transientIDependency1 = localInstance_1182D12736.GetDependency(); return new Service(transientIDependency1); } diff --git a/readme/bind-attribute-with-lifetime-and-tag.md b/readme/bind-attribute-with-lifetime-and-tag.md index 0964a7647..41c80f811 100644 --- a/readme/bind-attribute-with-lifetime-and-tag.md +++ b/readme/bind-attribute-with-lifetime-and-tag.md @@ -53,7 +53,7 @@ partial class Composition private readonly Lock _lock; private IDependency? _singletonIDependency0; - private Facade? _singletonFacade41; + private Facade? _singletonFacade43; [OrdinalAttribute(20)] public Composition() @@ -79,12 +79,12 @@ partial class Composition { if (_root._singletonIDependency0 is null) { - if (_root._singletonFacade41 is null) + if (_root._singletonFacade43 is null) { - _root._singletonFacade41 = new Facade(); + _root._singletonFacade43 = new Facade(); } - Facade localInstance_1182D12738 = _root._singletonFacade41!; + Facade localInstance_1182D12738 = _root._singletonFacade43!; _root._singletonIDependency0 = localInstance_1182D12738.Dependency; } } diff --git a/readme/bind-attribute.md b/readme/bind-attribute.md index 7887cbf12..d22889349 100644 --- a/readme/bind-attribute.md +++ b/readme/bind-attribute.md @@ -56,7 +56,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Facade? _singletonFacade41; + private Facade? _singletonFacade43; [OrdinalAttribute(20)] public Composition() @@ -76,19 +76,19 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonFacade41 is null) + if (_root._singletonFacade43 is null) { using (_lock.EnterScope()) { - if (_root._singletonFacade41 is null) + if (_root._singletonFacade43 is null) { - _root._singletonFacade41 = new Facade(); + _root._singletonFacade43 = new Facade(); } } } IDependency transientIDependency1; - Facade localInstance_1182D12737 = _root._singletonFacade41!; + Facade localInstance_1182D12737 = _root._singletonFacade43!; transientIDependency1 = localInstance_1182D12737.Dependency; return new Service(transientIDependency1); } diff --git a/readme/complex-generics.md b/readme/complex-generics.md index 9e909ec4b..ece7cd087 100644 --- a/readme/complex-generics.md +++ b/readme/complex-generics.md @@ -74,8 +74,8 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private DependencyStruct _singletonDependencyStruct49; - private bool _singletonDependencyStruct49Created; + private DependencyStruct _singletonDependencyStruct51; + private bool _singletonDependencyStruct51Created; [OrdinalAttribute(10)] public Composition() @@ -94,20 +94,20 @@ partial class Composition public Program GetRoot(T1 depArg) where T1: notnull { - if (!_root._singletonDependencyStruct49Created) + if (!_root._singletonDependencyStruct51Created) { using (_lock.EnterScope()) { - if (!_root._singletonDependencyStruct49Created) + if (!_root._singletonDependencyStruct51Created) { - _root._singletonDependencyStruct49 = new DependencyStruct(); + _root._singletonDependencyStruct51 = new DependencyStruct(); Thread.MemoryBarrier(); - _root._singletonDependencyStruct49Created = true; + _root._singletonDependencyStruct51Created = true; } } } - return new Program(new Service, Dictionary>(new Dependency(depArg), _root._singletonDependencyStruct49)); + return new Program(new Service, Dictionary>(new Dependency(depArg), _root._singletonDependencyStruct51)); } } ``` diff --git a/readme/default-lifetime-for-a-type-and-a-tag.md b/readme/default-lifetime-for-a-type-and-a-tag.md index 3e50c1589..1038e287e 100644 --- a/readme/default-lifetime-for-a-type-and-a-tag.md +++ b/readme/default-lifetime-for-a-type-and-a-tag.md @@ -53,8 +53,8 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Dependency? _singletonDependency41; - private Dependency? _singletonDependency42; + private Dependency? _singletonDependency43; + private Dependency? _singletonDependency44; [OrdinalAttribute(20)] public Composition() @@ -74,29 +74,29 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonDependency42 is null) + if (_root._singletonDependency44 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency42 is null) + if (_root._singletonDependency44 is null) { - _root._singletonDependency42 = new Dependency(); + _root._singletonDependency44 = new Dependency(); } } } - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - _root._singletonDependency41 = new Dependency(); + _root._singletonDependency43 = new Dependency(); } } } - return new Service(_root._singletonDependency41!, _root._singletonDependency42!); + return new Service(_root._singletonDependency43!, _root._singletonDependency44!); } } } diff --git a/readme/default-lifetime-for-a-type.md b/readme/default-lifetime-for-a-type.md index f70d0055f..d8c96fd44 100644 --- a/readme/default-lifetime-for-a-type.md +++ b/readme/default-lifetime-for-a-type.md @@ -52,7 +52,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Dependency? _singletonDependency41; + private Dependency? _singletonDependency43; [OrdinalAttribute(20)] public Composition() @@ -72,18 +72,18 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - _root._singletonDependency41 = new Dependency(); + _root._singletonDependency43 = new Dependency(); } } } - return new Service(_root._singletonDependency41!, _root._singletonDependency41!); + return new Service(_root._singletonDependency43!, _root._singletonDependency43!); } } } diff --git a/readme/default-lifetime.md b/readme/default-lifetime.md index 73dc33e76..30e2e445f 100644 --- a/readme/default-lifetime.md +++ b/readme/default-lifetime.md @@ -54,8 +54,8 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Service? _singletonService42; - private Dependency? _singletonDependency41; + private Service? _singletonService44; + private Dependency? _singletonDependency43; [OrdinalAttribute(20)] public Composition() @@ -75,23 +75,23 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonService42 is null) + if (_root._singletonService44 is null) { using (_lock.EnterScope()) { - if (_root._singletonService42 is null) + if (_root._singletonService44 is null) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - _root._singletonDependency41 = new Dependency(); + _root._singletonDependency43 = new Dependency(); } - _root._singletonService42 = new Service(_root._singletonDependency41!, _root._singletonDependency41!); + _root._singletonService44 = new Service(_root._singletonDependency43!, _root._singletonDependency43!); } } } - return _root._singletonService42!; + return _root._singletonService44!; } } } diff --git a/readme/disposable-singleton.md b/readme/disposable-singleton.md index dfa9f5f7e..2f553ca8f 100644 --- a/readme/disposable-singleton.md +++ b/readme/disposable-singleton.md @@ -57,7 +57,7 @@ partial class Composition: IDisposable private object[] _disposables; private int _disposeIndex; - private Dependency? _singletonDependency41; + private Dependency? _singletonDependency43; [OrdinalAttribute(20)] public Composition() @@ -79,19 +79,19 @@ partial class Composition: IDisposable [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - _root._singletonDependency41 = new Dependency(); - _root._disposables[_root._disposeIndex++] = _root._singletonDependency41; + _root._singletonDependency43 = new Dependency(); + _root._disposables[_root._disposeIndex++] = _root._singletonDependency43; } } } - return new Service(_root._singletonDependency41!); + return new Service(_root._singletonDependency43!); } } @@ -105,7 +105,7 @@ partial class Composition: IDisposable _disposeIndex = 0; disposables = _disposables; _disposables = new object[1]; - _singletonDependency41 = null; + _singletonDependency43 = null; } while (disposeIndex-- > 0) diff --git a/readme/exposed-generic-roots-with-args.md b/readme/exposed-generic-roots-with-args.md index ca3bba748..ac3d19699 100644 --- a/readme/exposed-generic-roots-with-args.md +++ b/readme/exposed-generic-roots-with-args.md @@ -43,7 +43,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Integration.CompositionWithGenericRootsAndArgsInOtherProject? _singletonCompositionWithGenericRootsAndArgsInOtherProject42; + private Integration.CompositionWithGenericRootsAndArgsInOtherProject? _singletonCompositionWithGenericRootsAndArgsInOtherProject44; [OrdinalAttribute(10)] public Composition() @@ -61,20 +61,20 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] public Program GetProgram(int id) { - if (_root._singletonCompositionWithGenericRootsAndArgsInOtherProject42 is null) + if (_root._singletonCompositionWithGenericRootsAndArgsInOtherProject44 is null) { using (_lock.EnterScope()) { - if (_root._singletonCompositionWithGenericRootsAndArgsInOtherProject42 is null) + if (_root._singletonCompositionWithGenericRootsAndArgsInOtherProject44 is null) { - _root._singletonCompositionWithGenericRootsAndArgsInOtherProject42 = new Integration.CompositionWithGenericRootsAndArgsInOtherProject(); + _root._singletonCompositionWithGenericRootsAndArgsInOtherProject44 = new Integration.CompositionWithGenericRootsAndArgsInOtherProject(); } } } Integration.IMyGenericService transientIMyGenericService1; int localId1 = id; - Integration.CompositionWithGenericRootsAndArgsInOtherProject localInstance_1182D1272 = _root._singletonCompositionWithGenericRootsAndArgsInOtherProject42!; + Integration.CompositionWithGenericRootsAndArgsInOtherProject localInstance_1182D1272 = _root._singletonCompositionWithGenericRootsAndArgsInOtherProject44!; transientIMyGenericService1 = localInstance_1182D1272.GetMyService(localId1); return new Program(transientIMyGenericService1); } diff --git a/readme/exposed-generic-roots.md b/readme/exposed-generic-roots.md index d7f5cb026..717e9ac01 100644 --- a/readme/exposed-generic-roots.md +++ b/readme/exposed-generic-roots.md @@ -44,7 +44,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Integration.CompositionWithGenericRootsInOtherProject? _singletonCompositionWithGenericRootsInOtherProject41; + private Integration.CompositionWithGenericRootsInOtherProject? _singletonCompositionWithGenericRootsInOtherProject43; [OrdinalAttribute(20)] public Composition() @@ -64,19 +64,19 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonCompositionWithGenericRootsInOtherProject41 is null) + if (_root._singletonCompositionWithGenericRootsInOtherProject43 is null) { using (_lock.EnterScope()) { - if (_root._singletonCompositionWithGenericRootsInOtherProject41 is null) + if (_root._singletonCompositionWithGenericRootsInOtherProject43 is null) { - _root._singletonCompositionWithGenericRootsInOtherProject41 = new Integration.CompositionWithGenericRootsInOtherProject(); + _root._singletonCompositionWithGenericRootsInOtherProject43 = new Integration.CompositionWithGenericRootsInOtherProject(); } } } Integration.IMyGenericService transientIMyGenericService1; - Integration.CompositionWithGenericRootsInOtherProject localInstance_1182D1270 = _root._singletonCompositionWithGenericRootsInOtherProject41!; + Integration.CompositionWithGenericRootsInOtherProject localInstance_1182D1270 = _root._singletonCompositionWithGenericRootsInOtherProject43!; transientIMyGenericService1 = localInstance_1182D1270.GetMyService(); return new Program(transientIMyGenericService1); } diff --git a/readme/exposed-roots-with-tags.md b/readme/exposed-roots-with-tags.md index 30bea69a3..1bfae74a1 100644 --- a/readme/exposed-roots-with-tags.md +++ b/readme/exposed-roots-with-tags.md @@ -39,7 +39,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Integration.CompositionWithTagsInOtherProject? _singletonCompositionWithTagsInOtherProject41; + private Integration.CompositionWithTagsInOtherProject? _singletonCompositionWithTagsInOtherProject43; [OrdinalAttribute(20)] public Composition() @@ -59,19 +59,19 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonCompositionWithTagsInOtherProject41 is null) + if (_root._singletonCompositionWithTagsInOtherProject43 is null) { using (_lock.EnterScope()) { - if (_root._singletonCompositionWithTagsInOtherProject41 is null) + if (_root._singletonCompositionWithTagsInOtherProject43 is null) { - _root._singletonCompositionWithTagsInOtherProject41 = new Integration.CompositionWithTagsInOtherProject(); + _root._singletonCompositionWithTagsInOtherProject43 = new Integration.CompositionWithTagsInOtherProject(); } } } Integration.IMyService transientIMyService1; - Integration.CompositionWithTagsInOtherProject localInstance_1182D1276 = _root._singletonCompositionWithTagsInOtherProject41!; + Integration.CompositionWithTagsInOtherProject localInstance_1182D1276 = _root._singletonCompositionWithTagsInOtherProject43!; transientIMyService1 = localInstance_1182D1276.MyService; return new Program(transientIMyService1); } diff --git a/readme/exposed-roots.md b/readme/exposed-roots.md index 6871591f3..61da8bc44 100644 --- a/readme/exposed-roots.md +++ b/readme/exposed-roots.md @@ -42,7 +42,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Integration.CompositionInOtherProject? _singletonCompositionInOtherProject41; + private Integration.CompositionInOtherProject? _singletonCompositionInOtherProject43; [OrdinalAttribute(20)] public Composition() @@ -62,19 +62,19 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonCompositionInOtherProject41 is null) + if (_root._singletonCompositionInOtherProject43 is null) { using (_lock.EnterScope()) { - if (_root._singletonCompositionInOtherProject41 is null) + if (_root._singletonCompositionInOtherProject43 is null) { - _root._singletonCompositionInOtherProject41 = new Integration.CompositionInOtherProject(); + _root._singletonCompositionInOtherProject43 = new Integration.CompositionInOtherProject(); } } } Integration.IMyService transientIMyService1; - Integration.CompositionInOtherProject localInstance_1182D1273 = _root._singletonCompositionInOtherProject41!; + Integration.CompositionInOtherProject localInstance_1182D1273 = _root._singletonCompositionInOtherProject43!; transientIMyService1 = localInstance_1182D1273.MyService; return new Program(transientIMyService1); } diff --git a/readme/func-with-arguments.md b/readme/func-with-arguments.md index b8efc7988..0bc0e7d6c 100644 --- a/readme/func-with-arguments.md +++ b/readme/func-with-arguments.md @@ -90,7 +90,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Clock? _singletonClock41; + private Clock? _singletonClock43; [OrdinalAttribute(20)] public Composition() @@ -119,18 +119,18 @@ partial class Composition // and source code statements "subId" int transientInt324 = subId; int transientInt323 = dependencyId; - if (_root._singletonClock41 is null) + if (_root._singletonClock43 is null) { using (_lock.EnterScope()) { - if (_root._singletonClock41 is null) + if (_root._singletonClock43 is null) { - _root._singletonClock41 = new Clock(); + _root._singletonClock43 = new Clock(); } } } - Dependency localDependency46 = new Dependency(_root._singletonClock41!, transientInt323, transientInt324); + Dependency localDependency46 = new Dependency(_root._singletonClock43!, transientInt323, transientInt324); return localDependency46; }; return new Service(transientFunc1); diff --git a/readme/keyed-service-provider.md b/readme/keyed-service-provider.md index 37c781b88..a57fb692d 100644 --- a/readme/keyed-service-provider.md +++ b/readme/keyed-service-provider.md @@ -53,7 +53,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Dependency? _singletonDependency41; + private Dependency? _singletonDependency43; [OrdinalAttribute(20)] public Composition() @@ -73,18 +73,18 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - _root._singletonDependency41 = new Dependency(); + _root._singletonDependency43 = new Dependency(); } } } - return _root._singletonDependency41!; + return _root._singletonDependency43!; } } @@ -93,18 +93,18 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - _root._singletonDependency41 = new Dependency(); + _root._singletonDependency43 = new Dependency(); } } } - return new Service(_root._singletonDependency41!); + return new Service(_root._singletonDependency43!); } } diff --git a/readme/onnewinstance-hint.md b/readme/onnewinstance-hint.md index 2e1a1b3e6..b11acab49 100644 --- a/readme/onnewinstance-hint.md +++ b/readme/onnewinstance-hint.md @@ -67,7 +67,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Dependency? _singletonDependency41; + private Dependency? _singletonDependency43; [OrdinalAttribute(20)] public Composition() @@ -87,22 +87,22 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - Dependency _singletonDependency41Temp; - _singletonDependency41Temp = new Dependency(); - OnNewInstance(ref _singletonDependency41Temp, null, Lifetime.Singleton); + Dependency _singletonDependency43Temp; + _singletonDependency43Temp = new Dependency(); + OnNewInstance(ref _singletonDependency43Temp, null, Lifetime.Singleton); Thread.MemoryBarrier(); - _root._singletonDependency41 = _singletonDependency41Temp; + _root._singletonDependency43 = _singletonDependency43Temp; } } } - Service transientService0 = new Service(_root._singletonDependency41!); + Service transientService0 = new Service(_root._singletonDependency43!); OnNewInstance(ref transientService0, null, Lifetime.Transient); return transientService0; } diff --git a/readme/perblock.md b/readme/perblock.md index faf8133eb..e4e835d38 100644 --- a/readme/perblock.md +++ b/readme/perblock.md @@ -52,8 +52,8 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private (IDependency dep3, IDependency dep4) _singletonValueTuple42; - private bool _singletonValueTuple42Created; + private (IDependency dep3, IDependency dep4) _singletonValueTuple44; + private bool _singletonValueTuple44Created; [OrdinalAttribute(20)] public Composition() @@ -73,22 +73,22 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (!_root._singletonValueTuple42Created) + if (!_root._singletonValueTuple44Created) { using (_lock.EnterScope()) { - if (!_root._singletonValueTuple42Created) + if (!_root._singletonValueTuple44Created) { Dependency perBlockDependency2 = new Dependency(); - _root._singletonValueTuple42 = (perBlockDependency2, perBlockDependency2); + _root._singletonValueTuple44 = (perBlockDependency2, perBlockDependency2); Thread.MemoryBarrier(); - _root._singletonValueTuple42Created = true; + _root._singletonValueTuple44Created = true; } } } Dependency perBlockDependency1 = new Dependency(); - return new Service(perBlockDependency1, perBlockDependency1, _root._singletonValueTuple42); + return new Service(perBlockDependency1, perBlockDependency1, _root._singletonValueTuple44); } } } diff --git a/readme/perresolve.md b/readme/perresolve.md index a6763efc9..03fd9ba0c 100644 --- a/readme/perresolve.md +++ b/readme/perresolve.md @@ -52,8 +52,8 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private (IDependency dep3, IDependency dep4) _singletonValueTuple42; - private bool _singletonValueTuple42Created; + private (IDependency dep3, IDependency dep4) _singletonValueTuple44; + private bool _singletonValueTuple44Created; [OrdinalAttribute(20)] public Composition() @@ -73,37 +73,37 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - var perResolveDependency41 = default(Dependency); - if (!_root._singletonValueTuple42Created) + var perResolveDependency43 = default(Dependency); + if (!_root._singletonValueTuple44Created) { using (_lock.EnterScope()) { - if (!_root._singletonValueTuple42Created) + if (!_root._singletonValueTuple44Created) { - if (perResolveDependency41 is null) + if (perResolveDependency43 is null) { - perResolveDependency41 = new Dependency(); + perResolveDependency43 = new Dependency(); } - _root._singletonValueTuple42 = (perResolveDependency41!, perResolveDependency41!); + _root._singletonValueTuple44 = (perResolveDependency43!, perResolveDependency43!); Thread.MemoryBarrier(); - _root._singletonValueTuple42Created = true; + _root._singletonValueTuple44Created = true; } } } - if (perResolveDependency41 is null) + if (perResolveDependency43 is null) { using (_lock.EnterScope()) { - if (perResolveDependency41 is null) + if (perResolveDependency43 is null) { - perResolveDependency41 = new Dependency(); + perResolveDependency43 = new Dependency(); } } } - return new Service(perResolveDependency41!, perResolveDependency41!, _root._singletonValueTuple42); + return new Service(perResolveDependency43!, perResolveDependency43!, _root._singletonValueTuple44); } } } diff --git a/readme/root-binding.md b/readme/root-binding.md index e9b593417..d040b7236 100644 --- a/readme/root-binding.md +++ b/readme/root-binding.md @@ -33,7 +33,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Dependency? _singletonDependency41; + private Dependency? _singletonDependency43; [OrdinalAttribute(20)] public Composition() @@ -53,18 +53,18 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - _root._singletonDependency41 = new Dependency(); + _root._singletonDependency43 = new Dependency(); } } } - return new Service(_root._singletonDependency41!); + return new Service(_root._singletonDependency43!); } } } diff --git a/readme/scope.md b/readme/scope.md index 84990f47f..40535789b 100644 --- a/readme/scope.md +++ b/readme/scope.md @@ -91,7 +91,7 @@ partial class Composition: IDisposable private object[] _disposables; private int _disposeIndex; - private Dependency? _scopedDependency41; + private Dependency? _scopedDependency43; [OrdinalAttribute(20)] public Composition() @@ -113,19 +113,19 @@ partial class Composition: IDisposable [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_scopedDependency41 is null) + if (_scopedDependency43 is null) { using (_lock.EnterScope()) { - if (_scopedDependency41 is null) + if (_scopedDependency43 is null) { - _scopedDependency41 = new Dependency(); - _disposables[_disposeIndex++] = _scopedDependency41; + _scopedDependency43 = new Dependency(); + _disposables[_disposeIndex++] = _scopedDependency43; } } } - return new Service(_scopedDependency41!); + return new Service(_scopedDependency43!); } } @@ -154,7 +154,7 @@ partial class Composition: IDisposable _disposeIndex = 0; disposables = _disposables; _disposables = new object[1]; - _scopedDependency41 = null; + _scopedDependency43 = null; } while (disposeIndex-- > 0) diff --git a/readme/service-collection.md b/readme/service-collection.md index 4e8935753..222971586 100644 --- a/readme/service-collection.md +++ b/readme/service-collection.md @@ -50,7 +50,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Dependency? _singletonDependency41; + private Dependency? _singletonDependency43; [OrdinalAttribute(20)] public Composition() @@ -70,18 +70,18 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - _root._singletonDependency41 = new Dependency(); + _root._singletonDependency43 = new Dependency(); } } } - return _root._singletonDependency41!; + return _root._singletonDependency43!; } } @@ -90,18 +90,18 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - _root._singletonDependency41 = new Dependency(); + _root._singletonDependency43 = new Dependency(); } } } - return new Service(_root._singletonDependency41!); + return new Service(_root._singletonDependency43!); } } diff --git a/readme/service-provider-with-scope.md b/readme/service-provider-with-scope.md index 8785281ae..5a0112243 100644 --- a/readme/service-provider-with-scope.md +++ b/readme/service-provider-with-scope.md @@ -81,8 +81,8 @@ partial class Composition: IDisposable private object[] _disposables; private int _disposeIndex; - private Service? _scopedService42; - private Dependency? _singletonDependency41; + private Service? _scopedService44; + private Dependency? _singletonDependency43; [OrdinalAttribute(20)] public Composition() @@ -104,18 +104,18 @@ partial class Composition: IDisposable [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - _root._singletonDependency41 = new Dependency(); + _root._singletonDependency43 = new Dependency(); } } } - return _root._singletonDependency41!; + return _root._singletonDependency43!; } } @@ -124,24 +124,24 @@ partial class Composition: IDisposable [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_scopedService42 is null) + if (_scopedService44 is null) { using (_lock.EnterScope()) { - if (_scopedService42 is null) + if (_scopedService44 is null) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - _root._singletonDependency41 = new Dependency(); + _root._singletonDependency43 = new Dependency(); } - _scopedService42 = new Service(_root._singletonDependency41!); - _disposables[_disposeIndex++] = _scopedService42; + _scopedService44 = new Service(_root._singletonDependency43!); + _disposables[_disposeIndex++] = _scopedService44; } } } - return _scopedService42!; + return _scopedService44!; } } @@ -215,8 +215,8 @@ partial class Composition: IDisposable _disposeIndex = 0; disposables = _disposables; _disposables = new object[1]; - _scopedService42 = null; - _singletonDependency41 = null; + _scopedService44 = null; + _singletonDependency43 = null; } while (disposeIndex-- > 0) diff --git a/readme/service-provider.md b/readme/service-provider.md index 617a5d985..76b633bca 100644 --- a/readme/service-provider.md +++ b/readme/service-provider.md @@ -48,7 +48,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Dependency? _singletonDependency41; + private Dependency? _singletonDependency43; [OrdinalAttribute(20)] public Composition() @@ -68,18 +68,18 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - _root._singletonDependency41 = new Dependency(); + _root._singletonDependency43 = new Dependency(); } } } - return _root._singletonDependency41!; + return _root._singletonDependency43!; } } @@ -88,18 +88,18 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - _root._singletonDependency41 = new Dependency(); + _root._singletonDependency43 = new Dependency(); } } } - return new Service(_root._singletonDependency41!); + return new Service(_root._singletonDependency43!); } } diff --git a/readme/singleton.md b/readme/singleton.md index 68724ae30..3282bc0e0 100644 --- a/readme/singleton.md +++ b/readme/singleton.md @@ -63,7 +63,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private Dependency? _singletonDependency41; + private Dependency? _singletonDependency43; [OrdinalAttribute(20)] public Composition() @@ -83,18 +83,18 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency41 is null) + if (_root._singletonDependency43 is null) { - _root._singletonDependency41 = new Dependency(); + _root._singletonDependency43 = new Dependency(); } } } - return new Service(_root._singletonDependency41!, _root._singletonDependency41!); + return new Service(_root._singletonDependency43!, _root._singletonDependency43!); } } } diff --git a/readme/tag-type.md b/readme/tag-type.md index 12cb2d33a..52f008270 100644 --- a/readme/tag-type.md +++ b/readme/tag-type.md @@ -63,7 +63,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private XyzDependency? _singletonXyzDependency42; + private XyzDependency? _singletonXyzDependency44; [OrdinalAttribute(20)] public Composition() @@ -83,18 +83,18 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonXyzDependency42 is null) + if (_root._singletonXyzDependency44 is null) { using (_lock.EnterScope()) { - if (_root._singletonXyzDependency42 is null) + if (_root._singletonXyzDependency44 is null) { - _root._singletonXyzDependency42 = new XyzDependency(); + _root._singletonXyzDependency44 = new XyzDependency(); } } } - return _root._singletonXyzDependency42!; + return _root._singletonXyzDependency44!; } } @@ -103,18 +103,18 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonXyzDependency42 is null) + if (_root._singletonXyzDependency44 is null) { using (_lock.EnterScope()) { - if (_root._singletonXyzDependency42 is null) + if (_root._singletonXyzDependency44 is null) { - _root._singletonXyzDependency42 = new XyzDependency(); + _root._singletonXyzDependency44 = new XyzDependency(); } } } - return new Service(new AbcDependency(), _root._singletonXyzDependency42!, new AbcDependency()); + return new Service(new AbcDependency(), _root._singletonXyzDependency44!, new AbcDependency()); } } diff --git a/readme/tags.md b/readme/tags.md index 50ee22312..ee15c438a 100644 --- a/readme/tags.md +++ b/readme/tags.md @@ -67,7 +67,7 @@ partial class Composition private readonly Composition _root; private readonly Lock _lock; - private XyzDependency? _singletonXyzDependency42; + private XyzDependency? _singletonXyzDependency44; [OrdinalAttribute(20)] public Composition() @@ -87,18 +87,18 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonXyzDependency42 is null) + if (_root._singletonXyzDependency44 is null) { using (_lock.EnterScope()) { - if (_root._singletonXyzDependency42 is null) + if (_root._singletonXyzDependency44 is null) { - _root._singletonXyzDependency42 = new XyzDependency(); + _root._singletonXyzDependency44 = new XyzDependency(); } } } - return _root._singletonXyzDependency42!; + return _root._singletonXyzDependency44!; } } @@ -107,18 +107,18 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonXyzDependency42 is null) + if (_root._singletonXyzDependency44 is null) { using (_lock.EnterScope()) { - if (_root._singletonXyzDependency42 is null) + if (_root._singletonXyzDependency44 is null) { - _root._singletonXyzDependency42 = new XyzDependency(); + _root._singletonXyzDependency44 = new XyzDependency(); } } } - return new Service(new AbcDependency(), _root._singletonXyzDependency42!, new AbcDependency()); + return new Service(new AbcDependency(), _root._singletonXyzDependency44!, new AbcDependency()); } } } diff --git a/readme/threadsafe-hint.md b/readme/threadsafe-hint.md index 20e5107cb..4e61a8ef0 100644 --- a/readme/threadsafe-hint.md +++ b/readme/threadsafe-hint.md @@ -36,7 +36,7 @@ partial class Composition { private readonly Composition _root; - private Service? _singletonService42; + private Service? _singletonService44; [OrdinalAttribute(20)] public Composition() @@ -54,17 +54,17 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - if (_root._singletonService42 is null) + if (_root._singletonService44 is null) { Func perBlockFunc0 = new Func([MethodImpl(MethodImplOptions.AggressiveInlining)] () => { IDependency localValue78 = new Dependency(); return localValue78; }); - _root._singletonService42 = new Service(perBlockFunc0); + _root._singletonService44 = new Service(perBlockFunc0); } - return _root._singletonService42!; + return _root._singletonService44!; } } } diff --git a/readme/tracking-async-disposable-instances-in-delegates.md b/readme/tracking-async-disposable-instances-in-delegates.md index 9d4b303d4..faddf9f8d 100644 --- a/readme/tracking-async-disposable-instances-in-delegates.md +++ b/readme/tracking-async-disposable-instances-in-delegates.md @@ -96,23 +96,23 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - var accumulator45 = new Owned(); + var accumulator47 = new Owned(); Func> perBlockFunc1 = new Func>([MethodImpl(MethodImplOptions.AggressiveInlining)] () => { - var accumulator45 = new Owned(); + var accumulator47 = new Owned(); Dependency transientDependency4 = new Dependency(); using (_lock.EnterScope()) { - accumulator45.Add(transientDependency4); + accumulator47.Add(transientDependency4); } Owned perBlockOwned2; // Creates the owner of an instance - Owned localOwned8 = accumulator45; + Owned localOwned8 = accumulator47; IDependency localValue9 = transientDependency4; perBlockOwned2 = new Owned(localValue9, localOwned8); using (_lock.EnterScope()) { - accumulator45.Add(perBlockOwned2); + accumulator47.Add(perBlockOwned2); } Owned localValue7 = perBlockOwned2; return localValue7; @@ -120,7 +120,7 @@ partial class Composition Service transientService0 = new Service(perBlockFunc1); using (_lock.EnterScope()) { - accumulator45.Add(transientService0); + accumulator47.Add(transientService0); } return transientService0; } diff --git a/readme/tracking-async-disposable-instances-per-a-composition-root.md b/readme/tracking-async-disposable-instances-per-a-composition-root.md index 815a692a3..000df8105 100644 --- a/readme/tracking-async-disposable-instances-per-a-composition-root.md +++ b/readme/tracking-async-disposable-instances-per-a-composition-root.md @@ -89,20 +89,20 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - var accumulator44 = new Owned(); + var accumulator46 = new Owned(); Dependency transientDependency3 = new Dependency(); using (_lock.EnterScope()) { - accumulator44.Add(transientDependency3); + accumulator46.Add(transientDependency3); } Owned perBlockOwned0; // Creates the owner of an instance - Owned localOwned10 = accumulator44; + Owned localOwned10 = accumulator46; IService localValue11 = new Service(transientDependency3); perBlockOwned0 = new Owned(localValue11, localOwned10); using (_lock.EnterScope()) { - accumulator44.Add(perBlockOwned0); + accumulator46.Add(perBlockOwned0); } return perBlockOwned0; } diff --git a/readme/tracking-disposable-instances-in-delegates.md b/readme/tracking-disposable-instances-in-delegates.md index b9974e28f..6b6fcb429 100644 --- a/readme/tracking-disposable-instances-in-delegates.md +++ b/readme/tracking-disposable-instances-in-delegates.md @@ -89,23 +89,23 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - var accumulator45 = new Owned(); + var accumulator47 = new Owned(); Func> perBlockFunc1 = new Func>([MethodImpl(MethodImplOptions.AggressiveInlining)] () => { - var accumulator45 = new Owned(); + var accumulator47 = new Owned(); Dependency transientDependency4 = new Dependency(); using (_lock.EnterScope()) { - accumulator45.Add(transientDependency4); + accumulator47.Add(transientDependency4); } Owned perBlockOwned2; // Creates the owner of an instance - Owned localOwned13 = accumulator45; + Owned localOwned13 = accumulator47; IDependency localValue14 = transientDependency4; perBlockOwned2 = new Owned(localValue14, localOwned13); using (_lock.EnterScope()) { - accumulator45.Add(perBlockOwned2); + accumulator47.Add(perBlockOwned2); } Owned localValue12 = perBlockOwned2; return localValue12; @@ -113,7 +113,7 @@ partial class Composition Service transientService0 = new Service(perBlockFunc1); using (_lock.EnterScope()) { - accumulator45.Add(transientService0); + accumulator47.Add(transientService0); } return transientService0; } diff --git a/readme/tracking-disposable-instances-per-a-composition-root.md b/readme/tracking-disposable-instances-per-a-composition-root.md index e3c0e2a3c..cbadefdd0 100644 --- a/readme/tracking-disposable-instances-per-a-composition-root.md +++ b/readme/tracking-disposable-instances-per-a-composition-root.md @@ -85,20 +85,20 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - var accumulator44 = new Owned(); + var accumulator46 = new Owned(); Dependency transientDependency3 = new Dependency(); using (_lock.EnterScope()) { - accumulator44.Add(transientDependency3); + accumulator46.Add(transientDependency3); } Owned perBlockOwned0; // Creates the owner of an instance - Owned localOwned15 = accumulator44; + Owned localOwned15 = accumulator46; IService localValue16 = new Service(transientDependency3); perBlockOwned0 = new Owned(localValue16, localOwned15); using (_lock.EnterScope()) { - accumulator44.Add(perBlockOwned0); + accumulator46.Add(perBlockOwned0); } return perBlockOwned0; } diff --git a/readme/tracking-disposable-instances-using-pre-built-classes.md b/readme/tracking-disposable-instances-using-pre-built-classes.md index b5f194be1..d003ff0dc 100644 --- a/readme/tracking-disposable-instances-using-pre-built-classes.md +++ b/readme/tracking-disposable-instances-using-pre-built-classes.md @@ -107,7 +107,7 @@ partial class Composition: IDisposable private object[] _disposables; private int _disposeIndex; - private Dependency? _singletonDependency42; + private Dependency? _singletonDependency44; [OrdinalAttribute(20)] public Composition() @@ -129,50 +129,50 @@ partial class Composition: IDisposable [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - var accumulator48 = new Abstractions.Own(); + var accumulator50 = new Abstractions.Own(); Func> perBlockFunc2 = new Func>([MethodImpl(MethodImplOptions.AggressiveInlining)] () => { - var accumulator48 = new Abstractions.Own(); - if (_root._singletonDependency42 is null) + var accumulator50 = new Abstractions.Own(); + if (_root._singletonDependency44 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency42 is null) + if (_root._singletonDependency44 is null) { - _root._singletonDependency42 = new Dependency(); - _root._disposables[_root._disposeIndex++] = _root._singletonDependency42; + _root._singletonDependency44 = new Dependency(); + _root._disposables[_root._disposeIndex++] = _root._singletonDependency44; } } } Abstractions.Own perBlockOwn3; // Creates the owner of an instance - Abstractions.Own localOwn18 = accumulator48; - IDependency localValue19 = _root._singletonDependency42!; + Abstractions.Own localOwn18 = accumulator50; + IDependency localValue19 = _root._singletonDependency44!; perBlockOwn3 = new Abstractions.Own(localValue19, localOwn18); using (_lock.EnterScope()) { - accumulator48.Add(perBlockOwn3); + accumulator50.Add(perBlockOwn3); } Abstractions.Own localValue17 = perBlockOwn3; return localValue17; }); Func> perBlockFunc1 = new Func>([MethodImpl(MethodImplOptions.AggressiveInlining)] () => { - var accumulator48 = new Abstractions.Own(); + var accumulator50 = new Abstractions.Own(); Dependency transientDependency7 = new Dependency(); using (_lock.EnterScope()) { - accumulator48.Add(transientDependency7); + accumulator50.Add(transientDependency7); } Abstractions.Own perBlockOwn5; // Creates the owner of an instance - Abstractions.Own localOwn21 = accumulator48; + Abstractions.Own localOwn21 = accumulator50; IDependency localValue22 = transientDependency7; perBlockOwn5 = new Abstractions.Own(localValue22, localOwn21); using (_lock.EnterScope()) { - accumulator48.Add(perBlockOwn5); + accumulator50.Add(perBlockOwn5); } Abstractions.Own localValue20 = perBlockOwn5; return localValue20; @@ -180,7 +180,7 @@ partial class Composition: IDisposable Service transientService0 = new Service(perBlockFunc1, perBlockFunc2); using (_lock.EnterScope()) { - accumulator48.Add(transientService0); + accumulator50.Add(transientService0); } return transientService0; } @@ -256,7 +256,7 @@ partial class Composition: IDisposable _disposeIndex = 0; disposables = _disposables; _disposables = new object[1]; - _singletonDependency42 = null; + _singletonDependency44 = null; } while (disposeIndex-- > 0) diff --git a/readme/tracking-disposable-instances-with-different-lifetimes.md b/readme/tracking-disposable-instances-with-different-lifetimes.md index 66ccce52f..3ea1d94b2 100644 --- a/readme/tracking-disposable-instances-with-different-lifetimes.md +++ b/readme/tracking-disposable-instances-with-different-lifetimes.md @@ -97,7 +97,7 @@ partial class Composition: IDisposable private object[] _disposables; private int _disposeIndex; - private Dependency? _singletonDependency42; + private Dependency? _singletonDependency44; [OrdinalAttribute(20)] public Composition() @@ -119,50 +119,50 @@ partial class Composition: IDisposable [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - var accumulator48 = new Owned(); + var accumulator50 = new Owned(); Func> perBlockFunc2 = new Func>([MethodImpl(MethodImplOptions.AggressiveInlining)] () => { - var accumulator48 = new Owned(); - if (_root._singletonDependency42 is null) + var accumulator50 = new Owned(); + if (_root._singletonDependency44 is null) { using (_lock.EnterScope()) { - if (_root._singletonDependency42 is null) + if (_root._singletonDependency44 is null) { - _root._singletonDependency42 = new Dependency(); - _root._disposables[_root._disposeIndex++] = _root._singletonDependency42; + _root._singletonDependency44 = new Dependency(); + _root._disposables[_root._disposeIndex++] = _root._singletonDependency44; } } } Owned perBlockOwned3; // Creates the owner of an instance - Owned localOwned24 = accumulator48; - IDependency localValue25 = _root._singletonDependency42!; + Owned localOwned24 = accumulator50; + IDependency localValue25 = _root._singletonDependency44!; perBlockOwned3 = new Owned(localValue25, localOwned24); using (_lock.EnterScope()) { - accumulator48.Add(perBlockOwned3); + accumulator50.Add(perBlockOwned3); } Owned localValue23 = perBlockOwned3; return localValue23; }); Func> perBlockFunc1 = new Func>([MethodImpl(MethodImplOptions.AggressiveInlining)] () => { - var accumulator48 = new Owned(); + var accumulator50 = new Owned(); Dependency transientDependency7 = new Dependency(); using (_lock.EnterScope()) { - accumulator48.Add(transientDependency7); + accumulator50.Add(transientDependency7); } Owned perBlockOwned5; // Creates the owner of an instance - Owned localOwned27 = accumulator48; + Owned localOwned27 = accumulator50; IDependency localValue28 = transientDependency7; perBlockOwned5 = new Owned(localValue28, localOwned27); using (_lock.EnterScope()) { - accumulator48.Add(perBlockOwned5); + accumulator50.Add(perBlockOwned5); } Owned localValue26 = perBlockOwned5; return localValue26; @@ -170,7 +170,7 @@ partial class Composition: IDisposable Service transientService0 = new Service(perBlockFunc1, perBlockFunc2); using (_lock.EnterScope()) { - accumulator48.Add(transientService0); + accumulator50.Add(transientService0); } return transientService0; } @@ -246,7 +246,7 @@ partial class Composition: IDisposable _disposeIndex = 0; disposables = _disposables; _disposables = new object[1]; - _singletonDependency42 = null; + _singletonDependency44 = null; } while (disposeIndex-- > 0)