From ada23cc6c6914dbb8f7f4ed4d8a03b0549a54384 Mon Sep 17 00:00:00 2001 From: Nikolay Pianikov Date: Mon, 12 Aug 2024 11:15:16 +0300 Subject: [PATCH] Update README.md --- readme/EnumDetails.md | 8 +- readme/FuncDetails.md | 4 +- readme/SingletonDetails.md | 12 +-- readme/accumulators.md | 22 ++--- readme/async-disposable-scope.md | 36 ++++---- readme/async-disposable-singleton.md | 12 +-- readme/async-enumerable.md | 6 +- readme/async-root.md | 38 ++++----- readme/auto-scoped.md | 46 +++++----- readme/bind-attribute-for-a-generic-type.md | 14 ++-- .../bind-attribute-with-lifetime-and-tag.md | 26 +++--- readme/bind-attribute.md | 14 ++-- readme/check-for-a-root.md | 2 +- .../default-lifetime-for-a-type-and-a-tag.md | 20 ++--- readme/default-lifetime-for-a-type.md | 10 +-- readme/default-lifetime.md | 20 ++--- readme/default-values.md | 2 +- readme/disposable-singleton.md | 12 +-- readme/enumerable-generics.md | 8 +- readme/enumerable.md | 4 +- readme/exposed-generic-roots-with-args.md | 16 ++-- readme/exposed-generic-roots.md | 14 ++-- readme/exposed-roots-via-arg.md | 4 +- readme/exposed-roots-via-root-arg.md | 4 +- readme/exposed-roots-with-tags.md | 14 ++-- readme/exposed-roots.md | 14 ++-- readme/factory.md | 6 +- readme/func-with-arguments.md | 24 +++--- readme/func-with-tag.md | 22 ++--- readme/func.md | 22 ++--- ...sync-composition-roots-with-constraints.md | 84 +++++++++---------- ...eric-composition-roots-with-constraints.md | 4 +- readme/generic-composition-roots.md | 4 +- readme/keyed-service-provider.md | 20 ++--- readme/lazy.md | 26 +++--- readme/manually-started-tasks.md | 28 +++---- readme/onnewinstance-hint.md | 18 ++-- readme/overriding-the-bcl-binding.md | 6 +- readme/perblock.md | 16 ++-- readme/perresolve.md | 34 ++++---- readme/required-properties-or-fields.md | 4 +- readme/root-binding.md | 10 +-- readme/scope.md | 36 ++++---- readme/service-collection.md | 20 ++--- readme/service-provider-with-scope.md | 32 +++---- readme/service-provider.md | 20 ++--- readme/simplified-factory.md | 8 +- readme/singleton.md | 10 +-- readme/span-and-readonlyspan.md | 6 +- readme/tag-on-a-member.md | 2 +- .../tag-on-injection-site-with-wildcards.md | 2 +- readme/tag-type.md | 20 ++--- readme/tag-unique.md | 4 +- readme/tags.md | 20 ++--- readme/task.md | 38 ++++----- ...async-disposable-instances-in-delegates.md | 56 ++++++------- ...osable-instances-per-a-composition-root.md | 10 +-- ...cking-disposable-instances-in-delegates.md | 56 ++++++------- ...osable-instances-per-a-composition-root.md | 10 +-- readme/valuetask.md | 4 +- 60 files changed, 532 insertions(+), 532 deletions(-) diff --git a/readme/EnumDetails.md b/readme/EnumDetails.md index 5ecf62aa..ddc5bf4a 100644 --- a/readme/EnumDetails.md +++ b/readme/EnumDetails.md @@ -100,10 +100,10 @@ partial class Enum [MethodImpl(MethodImplOptions.AggressiveInlining)] IEnumerable EnumerationOf_perBlockIEnumerable10() { - yield return new Service3(new Service4(), new Service4()); - yield return new Service3v2(new Service4(), new Service4()); - yield return new Service3v3(new Service4(), new Service4()); - yield return new Service3v4(new Service4(), new Service4()); + yield return new Service3(new Service4(), new Service4()); + yield return new Service3v2(new Service4(), new Service4()); + yield return new Service3v3(new Service4(), new Service4()); + yield return new Service3v4(new Service4(), new Service4()); } IEnumerable perBlockIEnumerable10 = EnumerationOf_perBlockIEnumerable10(); diff --git a/readme/FuncDetails.md b/readme/FuncDetails.md index 926880a7..872afaf2 100644 --- a/readme/FuncDetails.md +++ b/readme/FuncDetails.md @@ -83,8 +83,8 @@ partial class Func [MethodImpl(MethodImplOptions.AggressiveInlining)] () => { - IService3 localValue0 = new Service3(new Service4(), new Service4()); - return localValue0; + IService3 localValue0 = new Service3(new Service4(), new Service4()); + return localValue0; }); return new CompositionRoot(new Service1(new Service2Func(perBlockFunc10)), new Service2Func(perBlockFunc10), new Service2Func(perBlockFunc10), new Service2Func(perBlockFunc10), new Service3(new Service4(), new Service4()), new Service4(), new Service4()); } diff --git a/readme/SingletonDetails.md b/readme/SingletonDetails.md index 81839235..68813fd7 100644 --- a/readme/SingletonDetails.md +++ b/readme/SingletonDetails.md @@ -82,17 +82,17 @@ partial class Singleton { if (_scopedService443 == null) { - _scopedService443 = new Service4(); + _scopedService443 = new Service4(); } if (_scopedService140 == null) { - if (_scopedService443 == null) - { - _scopedService443 = new Service4(); - } + if (_scopedService443 == null) + { + _scopedService443 = new Service4(); + } - _scopedService140 = new Service1(new Service2(new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!))); + _scopedService140 = new Service1(new Service2(new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!))); } return new CompositionRoot(_scopedService140!, new Service2(new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!)), new Service2(new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!)), new Service2(new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!)), new Service3(_scopedService443!, _scopedService443!), _scopedService443!, _scopedService443!); diff --git a/readme/accumulators.md b/readme/accumulators.md index 9b97ec7e..3ddc00fe 100644 --- a/readme/accumulators.md +++ b/readme/accumulators.md @@ -73,29 +73,29 @@ partial class Composition AbcDependency perBlockAbcDependency4 = new AbcDependency(); if (_root._singletonXyzDependency41 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonXyzDependency41 == null) { - if (_root._singletonXyzDependency41 == null) - { - XyzDependency _singletonXyzDependency41Temp; - _singletonXyzDependency41Temp = new XyzDependency(); - accumulator44.Add(_singletonXyzDependency41Temp); - Thread.MemoryBarrier(); - _root._singletonXyzDependency41 = _singletonXyzDependency41Temp; - } + XyzDependency _singletonXyzDependency41Temp; + _singletonXyzDependency41Temp = new XyzDependency(); + accumulator44.Add(_singletonXyzDependency41Temp); + Thread.MemoryBarrier(); + _root._singletonXyzDependency41 = _singletonXyzDependency41Temp; } + } } AbcDependency transientAbcDependency3 = new AbcDependency(); lock (_lock) { - accumulator44.Add(transientAbcDependency3); + accumulator44.Add(transientAbcDependency3); } Service transientService1 = new Service(transientAbcDependency3, _root._singletonXyzDependency41!, perBlockAbcDependency4); lock (_lock) { - accumulator44.Add(transientService1); + accumulator44.Add(transientService1); } return (transientService1, accumulator44); diff --git a/readme/async-disposable-scope.md b/readme/async-disposable-scope.md index e07b5dc1..b94f9bfe 100644 --- a/readme/async-disposable-scope.md +++ b/readme/async-disposable-scope.md @@ -117,14 +117,14 @@ partial class Composition: IDisposable, IAsyncDisposable { if (_scopedDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_scopedDependency39 == null) { - if (_scopedDependency39 == null) - { - _scopedDependency39 = new Dependency(); - _disposables[_disposeIndex++] = _scopedDependency39; - } + _scopedDependency39 = new Dependency(); + _disposables[_disposeIndex++] = _scopedDependency39; } + } } return new Service(_scopedDependency39!); @@ -139,20 +139,20 @@ partial class Composition: IDisposable, IAsyncDisposable var perResolveFunc47 = default(Func); if (perResolveFunc47 == null) { - lock (_lock) + lock (_lock) + { + if (perResolveFunc47 == null) { - if (perResolveFunc47 == null) - { - perResolveFunc47 = new Func( - [MethodImpl(MethodImplOptions.AggressiveInlining)] - () => - { - Composition transientComposition2 = this; - Session localValue63 = new Session(transientComposition2); - return localValue63; - }); - } + perResolveFunc47 = new Func( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + () => + { + Composition transientComposition2 = this; + Session localValue63 = new Session(transientComposition2); + return localValue63; + }); } + } } return new Program(perResolveFunc47!); diff --git a/readme/async-disposable-singleton.md b/readme/async-disposable-singleton.md index b68a0294..5551c2b2 100644 --- a/readme/async-disposable-singleton.md +++ b/readme/async-disposable-singleton.md @@ -83,14 +83,14 @@ partial class Composition: IDisposable, IAsyncDisposable { if (_root._singletonDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonDependency39 == null) { - if (_root._singletonDependency39 == null) - { - _root._singletonDependency39 = new Dependency(); - _root._disposables[_root._disposeIndex++] = _root._singletonDependency39; - } + _root._singletonDependency39 = new Dependency(); + _root._disposables[_root._disposeIndex++] = _root._singletonDependency39; } + } } return new Service(_root._singletonDependency39!); diff --git a/readme/async-enumerable.md b/readme/async-enumerable.md index 74805d56..8917b73e 100644 --- a/readme/async-enumerable.md +++ b/readme/async-enumerable.md @@ -72,9 +72,9 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] async IAsyncEnumerable EnumerationOf_transientIAsyncEnumerable1() { - yield return new AbcDependency(); - yield return new XyzDependency(); - await Task.CompletedTask; + yield return new AbcDependency(); + yield return new XyzDependency(); + await Task.CompletedTask; } IAsyncEnumerable transientIAsyncEnumerable1 = EnumerationOf_transientIAsyncEnumerable1(); diff --git a/readme/async-root.md b/readme/async-root.md index d3213b61..621c053f 100644 --- a/readme/async-root.md +++ b/readme/async-root.md @@ -59,35 +59,35 @@ partial class Composition TaskCreationOptions transientTaskCreationOptions2 = TaskCreationOptions.None; TaskFactory perBlockTaskFactory1; { - CancellationToken localCancellationToken17 = cancellationToken; - TaskCreationOptions localTaskCreationOptions18 = transientTaskCreationOptions2; - TaskContinuationOptions localTaskContinuationOptions19 = transientTaskContinuationOptions3; - TaskScheduler localTaskScheduler20 = transientTaskScheduler4; - perBlockTaskFactory1 = new TaskFactory(localCancellationToken17, localTaskCreationOptions18, localTaskContinuationOptions19, localTaskScheduler20); + CancellationToken localCancellationToken17 = cancellationToken; + TaskCreationOptions localTaskCreationOptions18 = transientTaskCreationOptions2; + TaskContinuationOptions localTaskContinuationOptions19 = transientTaskContinuationOptions3; + TaskScheduler localTaskScheduler20 = transientTaskScheduler4; + perBlockTaskFactory1 = new TaskFactory(localCancellationToken17, localTaskCreationOptions18, localTaskContinuationOptions19, localTaskScheduler20); } if (perResolveFunc45 == null) { - lock (_lock) + lock (_lock) + { + if (perResolveFunc45 == null) { - if (perResolveFunc45 == null) - { - perResolveFunc45 = new Func( - [MethodImpl(MethodImplOptions.AggressiveInlining)] - () => - { - IService localValue21 = new Service(new Dependency()); - return localValue21; - }); - } + perResolveFunc45 = new Func( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + () => + { + IService localValue21 = new Service(new Dependency()); + return localValue21; + }); } + } } Task transientTask0; { - Func localFactory22 = perResolveFunc45!; - TaskFactory localTaskFactory23 = perBlockTaskFactory1; - transientTask0 = localTaskFactory23.StartNew(localFactory22); + Func localFactory22 = perResolveFunc45!; + TaskFactory localTaskFactory23 = perBlockTaskFactory1; + transientTask0 = localTaskFactory23.StartNew(localFactory22); } return transientTask0; diff --git a/readme/auto-scoped.md b/readme/auto-scoped.md index 30eb794c..69789ceb 100644 --- a/readme/auto-scoped.md +++ b/readme/auto-scoped.md @@ -98,28 +98,28 @@ partial class Composition var perResolveFunc46 = default(Func); if (perResolveFunc46 == null) { - lock (_lock) + lock (_lock) + { + if (perResolveFunc46 == null) { - if (perResolveFunc46 == null) + perResolveFunc46 = new Func( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + () => + { + Composition transientComposition2 = this; + IService transientIService1; { - perResolveFunc46 = new Func( - [MethodImpl(MethodImplOptions.AggressiveInlining)] - () => - { - Composition transientComposition2 = this; - IService transientIService1; - { - Composition localBaseComposition65 = transientComposition2; - // Creates a session - var localSession66 = new Composition(localBaseComposition65); - transientIService1 = localSession66.SessionRoot; - } - - IService localValue64 = transientIService1; - return localValue64; - }); + Composition localBaseComposition65 = transientComposition2; + // Creates a session + var localSession66 = new Composition(localBaseComposition65); + transientIService1 = localSession66.SessionRoot; } + + IService localValue64 = transientIService1; + return localValue64; + }); } + } } return new Program(perResolveFunc46!); @@ -133,13 +133,13 @@ partial class Composition { if (_scopedDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_scopedDependency39 == null) { - if (_scopedDependency39 == null) - { - _scopedDependency39 = new Dependency(); - } + _scopedDependency39 = new Dependency(); } + } } return new Service(_scopedDependency39!); diff --git a/readme/bind-attribute-for-a-generic-type.md b/readme/bind-attribute-for-a-generic-type.md index 488bb215..bd322cd0 100644 --- a/readme/bind-attribute-for-a-generic-type.md +++ b/readme/bind-attribute-for-a-generic-type.md @@ -72,19 +72,19 @@ partial class Composition { if (_root._singletonFacade39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonFacade39 == null) { - if (_root._singletonFacade39 == null) - { - _root._singletonFacade39 = new Facade(); - } + _root._singletonFacade39 = new Facade(); } + } } IDependency transientIDependency1; { - Facade localInstance_1182D12724 = _root._singletonFacade39!; - transientIDependency1 = localInstance_1182D12724.GetDependency(); + Facade localInstance_1182D12724 = _root._singletonFacade39!; + transientIDependency1 = localInstance_1182D12724.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 50ff374f..77107244 100644 --- a/readme/bind-attribute-with-lifetime-and-tag.md +++ b/readme/bind-attribute-with-lifetime-and-tag.md @@ -73,21 +73,21 @@ partial class Composition { if (_root._singletonIDependency0 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonIDependency0 == null) { - if (_root._singletonIDependency0 == null) - { - if (_root._singletonFacade39 == null) - { - _root._singletonFacade39 = new Facade(); - } - - { - Facade localInstance_1182D12726 = _root._singletonFacade39!; - _root._singletonIDependency0 = localInstance_1182D12726.Dependency; - } - } + if (_root._singletonFacade39 == null) + { + _root._singletonFacade39 = new Facade(); + } + + { + Facade localInstance_1182D12726 = _root._singletonFacade39!; + _root._singletonIDependency0 = localInstance_1182D12726.Dependency; + } } + } } return new Service(_root._singletonIDependency0!); diff --git a/readme/bind-attribute.md b/readme/bind-attribute.md index 12009b4c..9772574f 100644 --- a/readme/bind-attribute.md +++ b/readme/bind-attribute.md @@ -76,19 +76,19 @@ partial class Composition { if (_root._singletonFacade39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonFacade39 == null) { - if (_root._singletonFacade39 == null) - { - _root._singletonFacade39 = new Facade(); - } + _root._singletonFacade39 = new Facade(); } + } } IDependency transientIDependency1; { - Facade localInstance_1182D12725 = _root._singletonFacade39!; - transientIDependency1 = localInstance_1182D12725.Dependency; + Facade localInstance_1182D12725 = _root._singletonFacade39!; + transientIDependency1 = localInstance_1182D12725.Dependency; } return new Service(transientIDependency1); diff --git a/readme/check-for-a-root.md b/readme/check-for-a-root.md index cd4c1e6c..a9141580 100644 --- a/readme/check-for-a-root.md +++ b/readme/check-for-a-root.md @@ -86,7 +86,7 @@ partial class Composition { return new Service() { - Dependency = new Dependency() + Dependency = new Dependency() }; } } 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 0ced6839..d158d8c4 100644 --- a/readme/default-lifetime-for-a-type-and-a-tag.md +++ b/readme/default-lifetime-for-a-type-and-a-tag.md @@ -77,24 +77,24 @@ partial class Composition { if (_root._singletonDependency40 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonDependency40 == null) { - if (_root._singletonDependency40 == null) - { - _root._singletonDependency40 = new Dependency(); - } + _root._singletonDependency40 = new Dependency(); } + } } if (_root._singletonDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonDependency39 == null) { - if (_root._singletonDependency39 == null) - { - _root._singletonDependency39 = new Dependency(); - } + _root._singletonDependency39 = new Dependency(); } + } } return new Service(_root._singletonDependency39!, _root._singletonDependency40!); diff --git a/readme/default-lifetime-for-a-type.md b/readme/default-lifetime-for-a-type.md index c9b69572..597c2cd0 100644 --- a/readme/default-lifetime-for-a-type.md +++ b/readme/default-lifetime-for-a-type.md @@ -75,13 +75,13 @@ partial class Composition { if (_root._singletonDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonDependency39 == null) { - if (_root._singletonDependency39 == null) - { - _root._singletonDependency39 = new Dependency(); - } + _root._singletonDependency39 = new Dependency(); } + } } return new Service(_root._singletonDependency39!, _root._singletonDependency39!); diff --git a/readme/default-lifetime.md b/readme/default-lifetime.md index f905c974..3a100173 100644 --- a/readme/default-lifetime.md +++ b/readme/default-lifetime.md @@ -78,18 +78,18 @@ partial class Composition { if (_root._singletonService40 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonService40 == null) { - if (_root._singletonService40 == null) - { - if (_root._singletonDependency39 == null) - { - _root._singletonDependency39 = new Dependency(); - } - - _root._singletonService40 = new Service(_root._singletonDependency39!, _root._singletonDependency39!); - } + if (_root._singletonDependency39 == null) + { + _root._singletonDependency39 = new Dependency(); + } + + _root._singletonService40 = new Service(_root._singletonDependency39!, _root._singletonDependency39!); } + } } return _root._singletonService40!; diff --git a/readme/default-values.md b/readme/default-values.md index 40bfa0b1..501302e5 100644 --- a/readme/default-values.md +++ b/readme/default-values.md @@ -62,7 +62,7 @@ partial class Composition { return new Service() { - Dependency = new Dependency() + Dependency = new Dependency() }; } } diff --git a/readme/disposable-singleton.md b/readme/disposable-singleton.md index 879103f5..78fb10d5 100644 --- a/readme/disposable-singleton.md +++ b/readme/disposable-singleton.md @@ -81,14 +81,14 @@ partial class Composition: IDisposable { if (_root._singletonDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonDependency39 == null) { - if (_root._singletonDependency39 == null) - { - _root._singletonDependency39 = new Dependency(); - _root._disposables[_root._disposeIndex++] = _root._singletonDependency39; - } + _root._singletonDependency39 = new Dependency(); + _root._disposables[_root._disposeIndex++] = _root._singletonDependency39; } + } } return new Service(_root._singletonDependency39!); diff --git a/readme/enumerable-generics.md b/readme/enumerable-generics.md index 3ebe3c74..c798eecf 100644 --- a/readme/enumerable-generics.md +++ b/readme/enumerable-generics.md @@ -69,8 +69,8 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] IEnumerable> EnumerationOf_perBlockIEnumerable1() { - yield return new AbcDependency(); - yield return new XyzDependency(); + yield return new AbcDependency(); + yield return new XyzDependency(); } IEnumerable> perBlockIEnumerable1 = EnumerationOf_perBlockIEnumerable1(); @@ -86,8 +86,8 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] IEnumerable> EnumerationOf_perBlockIEnumerable1() { - yield return new AbcDependency(); - yield return new XyzDependency(); + yield return new AbcDependency(); + yield return new XyzDependency(); } IEnumerable> perBlockIEnumerable1 = EnumerationOf_perBlockIEnumerable1(); diff --git a/readme/enumerable.md b/readme/enumerable.md index 642285c0..d64b4226 100644 --- a/readme/enumerable.md +++ b/readme/enumerable.md @@ -64,8 +64,8 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] IEnumerable EnumerationOf_perBlockIEnumerable1() { - yield return new AbcDependency(); - yield return new XyzDependency(); + yield return new AbcDependency(); + yield return new XyzDependency(); } IEnumerable perBlockIEnumerable1 = EnumerationOf_perBlockIEnumerable1(); diff --git a/readme/exposed-generic-roots-with-args.md b/readme/exposed-generic-roots-with-args.md index ec044203..cb185ae1 100644 --- a/readme/exposed-generic-roots-with-args.md +++ b/readme/exposed-generic-roots-with-args.md @@ -63,20 +63,20 @@ partial class Composition { if (_root._singletonCompositionWithGenericRootsAndArgsInOtherProject40 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonCompositionWithGenericRootsAndArgsInOtherProject40 == null) { - if (_root._singletonCompositionWithGenericRootsAndArgsInOtherProject40 == null) - { - _root._singletonCompositionWithGenericRootsAndArgsInOtherProject40 = new Integration.CompositionWithGenericRootsAndArgsInOtherProject(); - } + _root._singletonCompositionWithGenericRootsAndArgsInOtherProject40 = new Integration.CompositionWithGenericRootsAndArgsInOtherProject(); } + } } Integration.IMyGenericService transientIMyGenericService1; { - int localId1 = id; - Integration.CompositionWithGenericRootsAndArgsInOtherProject localInstance_1182D1272 = _root._singletonCompositionWithGenericRootsAndArgsInOtherProject40!; - transientIMyGenericService1 = localInstance_1182D1272.GetMyService(localId1); + int localId1 = id; + Integration.CompositionWithGenericRootsAndArgsInOtherProject localInstance_1182D1272 = _root._singletonCompositionWithGenericRootsAndArgsInOtherProject40!; + transientIMyGenericService1 = localInstance_1182D1272.GetMyService(localId1); } return new Program(transientIMyGenericService1); diff --git a/readme/exposed-generic-roots.md b/readme/exposed-generic-roots.md index a8265c66..13eff755 100644 --- a/readme/exposed-generic-roots.md +++ b/readme/exposed-generic-roots.md @@ -66,19 +66,19 @@ partial class Composition { if (_root._singletonCompositionWithGenericRootsInOtherProject39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonCompositionWithGenericRootsInOtherProject39 == null) { - if (_root._singletonCompositionWithGenericRootsInOtherProject39 == null) - { - _root._singletonCompositionWithGenericRootsInOtherProject39 = new Integration.CompositionWithGenericRootsInOtherProject(); - } + _root._singletonCompositionWithGenericRootsInOtherProject39 = new Integration.CompositionWithGenericRootsInOtherProject(); } + } } Integration.IMyGenericService transientIMyGenericService1; { - Integration.CompositionWithGenericRootsInOtherProject localInstance_1182D1270 = _root._singletonCompositionWithGenericRootsInOtherProject39!; - transientIMyGenericService1 = localInstance_1182D1270.GetMyService(); + Integration.CompositionWithGenericRootsInOtherProject localInstance_1182D1270 = _root._singletonCompositionWithGenericRootsInOtherProject39!; + transientIMyGenericService1 = localInstance_1182D1270.GetMyService(); } return new Program(transientIMyGenericService1); diff --git a/readme/exposed-roots-via-arg.md b/readme/exposed-roots-via-arg.md index db1b0ed1..967ef55e 100644 --- a/readme/exposed-roots-via-arg.md +++ b/readme/exposed-roots-via-arg.md @@ -61,8 +61,8 @@ partial class Composition { Integration.IMyService transientIMyService1; { - Integration.CompositionInOtherProject localInstance_1182D1274 = _argBaseComposition; - transientIMyService1 = localInstance_1182D1274.MyService; + Integration.CompositionInOtherProject localInstance_1182D1274 = _argBaseComposition; + transientIMyService1 = localInstance_1182D1274.MyService; } return new Program(transientIMyService1); diff --git a/readme/exposed-roots-via-root-arg.md b/readme/exposed-roots-via-root-arg.md index 5e5ddb97..a3812762 100644 --- a/readme/exposed-roots-via-root-arg.md +++ b/readme/exposed-roots-via-root-arg.md @@ -56,8 +56,8 @@ partial class Composition { Integration.IMyService transientIMyService1; { - Integration.CompositionInOtherProject localInstance_1182D1275 = baseComposition; - transientIMyService1 = localInstance_1182D1275.MyService; + Integration.CompositionInOtherProject localInstance_1182D1275 = baseComposition; + transientIMyService1 = localInstance_1182D1275.MyService; } return new Program(transientIMyService1); diff --git a/readme/exposed-roots-with-tags.md b/readme/exposed-roots-with-tags.md index cb1eb24b..fe5e2e82 100644 --- a/readme/exposed-roots-with-tags.md +++ b/readme/exposed-roots-with-tags.md @@ -61,19 +61,19 @@ partial class Composition { if (_root._singletonCompositionWithTagsInOtherProject39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonCompositionWithTagsInOtherProject39 == null) { - if (_root._singletonCompositionWithTagsInOtherProject39 == null) - { - _root._singletonCompositionWithTagsInOtherProject39 = new Integration.CompositionWithTagsInOtherProject(); - } + _root._singletonCompositionWithTagsInOtherProject39 = new Integration.CompositionWithTagsInOtherProject(); } + } } Integration.IMyService transientIMyService1; { - Integration.CompositionWithTagsInOtherProject localInstance_1182D1276 = _root._singletonCompositionWithTagsInOtherProject39!; - transientIMyService1 = localInstance_1182D1276.MyService; + Integration.CompositionWithTagsInOtherProject localInstance_1182D1276 = _root._singletonCompositionWithTagsInOtherProject39!; + transientIMyService1 = localInstance_1182D1276.MyService; } return new Program(transientIMyService1); diff --git a/readme/exposed-roots.md b/readme/exposed-roots.md index c58d40fb..08e13f65 100644 --- a/readme/exposed-roots.md +++ b/readme/exposed-roots.md @@ -64,19 +64,19 @@ partial class Composition { if (_root._singletonCompositionInOtherProject39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonCompositionInOtherProject39 == null) { - if (_root._singletonCompositionInOtherProject39 == null) - { - _root._singletonCompositionInOtherProject39 = new Integration.CompositionInOtherProject(); - } + _root._singletonCompositionInOtherProject39 = new Integration.CompositionInOtherProject(); } + } } Integration.IMyService transientIMyService1; { - Integration.CompositionInOtherProject localInstance_1182D1273 = _root._singletonCompositionInOtherProject39!; - transientIMyService1 = localInstance_1182D1273.MyService; + Integration.CompositionInOtherProject localInstance_1182D1273 = _root._singletonCompositionInOtherProject39!; + transientIMyService1 = localInstance_1182D1273.MyService; } return new Program(transientIMyService1); diff --git a/readme/factory.md b/readme/factory.md index 43622b95..78b8f381 100644 --- a/readme/factory.md +++ b/readme/factory.md @@ -91,9 +91,9 @@ partial class Composition DateTimeOffset transientDateTimeOffset3 = DateTimeOffset.Now; Dependency transientDependency1; { - Dependency localDependency27 = new Dependency(transientDateTimeOffset3); - localDependency27.Initialize(); - transientDependency1 = localDependency27; + Dependency localDependency27 = new Dependency(transientDateTimeOffset3); + localDependency27.Initialize(); + transientDependency1 = localDependency27; } return new Service(transientDependency1); diff --git a/readme/func-with-arguments.md b/readme/func-with-arguments.md index 7fd771e4..dcb23dac 100644 --- a/readme/func-with-arguments.md +++ b/readme/func-with-arguments.md @@ -113,21 +113,21 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] (dependencyId, subId) => { - int transientInt324 = subId; - int transientInt323 = dependencyId; - if (_root._singletonClock39 == null) + int transientInt324 = subId; + int transientInt323 = dependencyId; + if (_root._singletonClock39 == null) + { + lock (_lock) { - lock (_lock) - { - if (_root._singletonClock39 == null) - { - _root._singletonClock39 = new Clock(); - } - } + if (_root._singletonClock39 == null) + { + _root._singletonClock39 = new Clock(); + } } + } - Dependency localDependency31 = new Dependency(_root._singletonClock39!, transientInt323, transientInt324); - return localDependency31; + Dependency localDependency31 = new Dependency(_root._singletonClock39!, transientInt323, transientInt324); + return localDependency31; }; return new Service(transientFunc1); } diff --git a/readme/func-with-tag.md b/readme/func-with-tag.md index da549017..622a064f 100644 --- a/readme/func-with-tag.md +++ b/readme/func-with-tag.md @@ -65,19 +65,19 @@ partial class Composition var perResolveFunc42 = default(Func); if (perResolveFunc42 == null) { - lock (_lock) + lock (_lock) + { + if (perResolveFunc42 == null) { - if (perResolveFunc42 == null) - { - perResolveFunc42 = new Func( - [MethodImpl(MethodImplOptions.AggressiveInlining)] - () => - { - IDependency localValue32 = new Dependency(); - return localValue32; - }); - } + perResolveFunc42 = new Func( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + () => + { + IDependency localValue32 = new Dependency(); + return localValue32; + }); } + } } return new Service(perResolveFunc42!); diff --git a/readme/func.md b/readme/func.md index 49011b4a..d088b1b9 100644 --- a/readme/func.md +++ b/readme/func.md @@ -68,19 +68,19 @@ partial class Composition var perResolveFunc42 = default(Func); if (perResolveFunc42 == null) { - lock (_lock) + lock (_lock) + { + if (perResolveFunc42 == null) { - if (perResolveFunc42 == null) - { - perResolveFunc42 = new Func( - [MethodImpl(MethodImplOptions.AggressiveInlining)] - () => - { - IDependency localValue30 = new Dependency(); - return localValue30; - }); - } + perResolveFunc42 = new Func( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + () => + { + IDependency localValue30 = new Dependency(); + return localValue30; + }); } + } } return new Service(perResolveFunc42!); diff --git a/readme/generic-async-composition-roots-with-constraints.md b/readme/generic-async-composition-roots-with-constraints.md index b5815f96..4f26ced7 100644 --- a/readme/generic-async-composition-roots-with-constraints.md +++ b/readme/generic-async-composition-roots-with-constraints.md @@ -93,41 +93,41 @@ partial class Composition TaskCreationOptions transientTaskCreationOptions2 = TaskCreationOptions.None; TaskFactory> perBlockTaskFactory1; { - CancellationToken localCancellationToken46 = cancellationToken; - TaskCreationOptions localTaskCreationOptions47 = transientTaskCreationOptions2; - TaskContinuationOptions localTaskContinuationOptions48 = transientTaskContinuationOptions3; - TaskScheduler localTaskScheduler49 = transientTaskScheduler4; - perBlockTaskFactory1 = new TaskFactory>(localCancellationToken46, localTaskCreationOptions47, localTaskContinuationOptions48, localTaskScheduler49); + CancellationToken localCancellationToken46 = cancellationToken; + TaskCreationOptions localTaskCreationOptions47 = transientTaskCreationOptions2; + TaskContinuationOptions localTaskContinuationOptions48 = transientTaskContinuationOptions3; + TaskScheduler localTaskScheduler49 = transientTaskScheduler4; + perBlockTaskFactory1 = new TaskFactory>(localCancellationToken46, localTaskCreationOptions47, localTaskContinuationOptions48, localTaskScheduler49); } if (perResolveFunc48 == null) { - lock (_lock) + lock (_lock) + { + if (perResolveFunc48 == null) { - if (perResolveFunc48 == null) + perResolveFunc48 = new Func>( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + () => + { + OtherService transientOtherService5; { - perResolveFunc48 = new Func>( - [MethodImpl(MethodImplOptions.AggressiveInlining)] - () => - { - OtherService transientOtherService5; - { - IDependency localDependency51 = new Dependency(); - transientOtherService5 = new OtherService(localDependency51); - } - - IService localValue50 = transientOtherService5; - return localValue50; - }); + IDependency localDependency51 = new Dependency(); + transientOtherService5 = new OtherService(localDependency51); } + + IService localValue50 = transientOtherService5; + return localValue50; + }); } + } } Task> transientTask0; { - Func> localFactory52 = perResolveFunc48!; - TaskFactory> localTaskFactory53 = perBlockTaskFactory1; - transientTask0 = localTaskFactory53.StartNew(localFactory52); + Func> localFactory52 = perResolveFunc48!; + TaskFactory> localTaskFactory53 = perBlockTaskFactory1; + transientTask0 = localTaskFactory53.StartNew(localFactory52); } return transientTask0; @@ -144,35 +144,35 @@ partial class Composition TaskCreationOptions transientTaskCreationOptions2 = TaskCreationOptions.None; TaskFactory> perBlockTaskFactory1; { - CancellationToken localCancellationToken54 = cancellationToken; - TaskCreationOptions localTaskCreationOptions55 = transientTaskCreationOptions2; - TaskContinuationOptions localTaskContinuationOptions56 = transientTaskContinuationOptions3; - TaskScheduler localTaskScheduler57 = transientTaskScheduler4; - perBlockTaskFactory1 = new TaskFactory>(localCancellationToken54, localTaskCreationOptions55, localTaskContinuationOptions56, localTaskScheduler57); + CancellationToken localCancellationToken54 = cancellationToken; + TaskCreationOptions localTaskCreationOptions55 = transientTaskCreationOptions2; + TaskContinuationOptions localTaskContinuationOptions56 = transientTaskContinuationOptions3; + TaskScheduler localTaskScheduler57 = transientTaskScheduler4; + perBlockTaskFactory1 = new TaskFactory>(localCancellationToken54, localTaskCreationOptions55, localTaskContinuationOptions56, localTaskScheduler57); } if (perResolveFunc50 == null) { - lock (_lock) + lock (_lock) + { + if (perResolveFunc50 == null) { - if (perResolveFunc50 == null) - { - perResolveFunc50 = new Func>( - [MethodImpl(MethodImplOptions.AggressiveInlining)] - () => - { - IService localValue58 = new Service(new Dependency()); - return localValue58; - }); - } + perResolveFunc50 = new Func>( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + () => + { + IService localValue58 = new Service(new Dependency()); + return localValue58; + }); } + } } Task> transientTask0; { - Func> localFactory59 = perResolveFunc50!; - TaskFactory> localTaskFactory60 = perBlockTaskFactory1; - transientTask0 = localTaskFactory60.StartNew(localFactory59); + Func> localFactory59 = perResolveFunc50!; + TaskFactory> localTaskFactory60 = perBlockTaskFactory1; + transientTask0 = localTaskFactory60.StartNew(localFactory59); } return transientTask0; diff --git a/readme/generic-composition-roots-with-constraints.md b/readme/generic-composition-roots-with-constraints.md index 7e7e05b5..a4d254d2 100644 --- a/readme/generic-composition-roots-with-constraints.md +++ b/readme/generic-composition-roots-with-constraints.md @@ -84,8 +84,8 @@ partial class Composition { OtherService transientOtherService0; { - IDependency localDependency61 = new Dependency(); - transientOtherService0 = new OtherService(localDependency61); + IDependency localDependency61 = new Dependency(); + transientOtherService0 = new OtherService(localDependency61); } return transientOtherService0; diff --git a/readme/generic-composition-roots.md b/readme/generic-composition-roots.md index 52bc146b..7220da80 100644 --- a/readme/generic-composition-roots.md +++ b/readme/generic-composition-roots.md @@ -77,8 +77,8 @@ partial class Composition { OtherService transientOtherService0; { - IDependency localDependency62 = new Dependency(); - transientOtherService0 = new OtherService(localDependency62); + IDependency localDependency62 = new Dependency(); + transientOtherService0 = new OtherService(localDependency62); } return transientOtherService0; diff --git a/readme/keyed-service-provider.md b/readme/keyed-service-provider.md index 5c1da360..b7080310 100644 --- a/readme/keyed-service-provider.md +++ b/readme/keyed-service-provider.md @@ -75,13 +75,13 @@ partial class Composition { if (_root._singletonDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonDependency39 == null) { - if (_root._singletonDependency39 == null) - { - _root._singletonDependency39 = new Dependency(); - } + _root._singletonDependency39 = new Dependency(); } + } } return _root._singletonDependency39!; @@ -95,13 +95,13 @@ partial class Composition { if (_root._singletonDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonDependency39 == null) { - if (_root._singletonDependency39 == null) - { - _root._singletonDependency39 = new Dependency(); - } + _root._singletonDependency39 = new Dependency(); } + } } return new Service(_root._singletonDependency39!); diff --git a/readme/lazy.md b/readme/lazy.md index 8c3f8dd9..ed758de3 100644 --- a/readme/lazy.md +++ b/readme/lazy.md @@ -59,25 +59,25 @@ partial class Composition var perResolveFunc43 = default(Func); if (perResolveFunc43 == null) { - lock (_lock) + lock (_lock) + { + if (perResolveFunc43 == null) { - if (perResolveFunc43 == null) - { - perResolveFunc43 = new Func( - [MethodImpl(MethodImplOptions.AggressiveInlining)] - () => - { - IDependency localValue33 = new Dependency(); - return localValue33; - }); - } + perResolveFunc43 = new Func( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + () => + { + IDependency localValue33 = new Dependency(); + return localValue33; + }); } + } } Lazy transientLazy1; { - Func localFactory34 = perResolveFunc43!; - transientLazy1 = new Lazy(localFactory34, true); + Func localFactory34 = perResolveFunc43!; + transientLazy1 = new Lazy(localFactory34, true); } return new Service(transientLazy1); diff --git a/readme/manually-started-tasks.md b/readme/manually-started-tasks.md index 068a3807..20c73137 100644 --- a/readme/manually-started-tasks.md +++ b/readme/manually-started-tasks.md @@ -97,26 +97,26 @@ partial class Composition var perResolveFunc45 = default(Func); if (perResolveFunc45 == null) { - lock (_lock) + lock (_lock) + { + if (perResolveFunc45 == null) { - if (perResolveFunc45 == null) - { - perResolveFunc45 = new Func( - [MethodImpl(MethodImplOptions.AggressiveInlining)] - () => - { - IDependency localValue35 = new Dependency(); - return localValue35; - }); - } + perResolveFunc45 = new Func( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + () => + { + IDependency localValue35 = new Dependency(); + return localValue35; + }); } + } } Task transientTask1; { - Func localFactory36 = perResolveFunc45!; - CancellationToken localCancellationToken37 = cancellationToken; - transientTask1 = new Task(localFactory36, localCancellationToken37); + Func localFactory36 = perResolveFunc45!; + CancellationToken localCancellationToken37 = cancellationToken; + transientTask1 = new Task(localFactory36, localCancellationToken37); } return new Service(transientTask1); diff --git a/readme/onnewinstance-hint.md b/readme/onnewinstance-hint.md index 7a5f0cbb..436f76c3 100644 --- a/readme/onnewinstance-hint.md +++ b/readme/onnewinstance-hint.md @@ -89,17 +89,17 @@ partial class Composition { if (_root._singletonDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonDependency39 == null) { - if (_root._singletonDependency39 == null) - { - Dependency _singletonDependency39Temp; - _singletonDependency39Temp = new Dependency(); - OnNewInstance(ref _singletonDependency39Temp, null, Lifetime.Singleton); - Thread.MemoryBarrier(); - _root._singletonDependency39 = _singletonDependency39Temp; - } + Dependency _singletonDependency39Temp; + _singletonDependency39Temp = new Dependency(); + OnNewInstance(ref _singletonDependency39Temp, null, Lifetime.Singleton); + Thread.MemoryBarrier(); + _root._singletonDependency39 = _singletonDependency39Temp; } + } } Service transientService0 = new Service(_root._singletonDependency39!); diff --git a/readme/overriding-the-bcl-binding.md b/readme/overriding-the-bcl-binding.md index 9c043d9b..5526040b 100644 --- a/readme/overriding-the-bcl-binding.md +++ b/readme/overriding-the-bcl-binding.md @@ -67,9 +67,9 @@ partial class Composition { IDependency[] transient1 = new IDependency[] { - new AbcDependency(), - new XyzDependency(), - new AbcDependency() + new AbcDependency(), + new XyzDependency(), + new AbcDependency() }; return new Service(transient1); } diff --git a/readme/perblock.md b/readme/perblock.md index 6505b85d..f9a4f70f 100644 --- a/readme/perblock.md +++ b/readme/perblock.md @@ -75,16 +75,16 @@ partial class Composition { if (!_root._singletonValueTuple40Created) { - lock (_lock) + lock (_lock) + { + if (!_root._singletonValueTuple40Created) { - if (!_root._singletonValueTuple40Created) - { - Dependency perBlockDependency2 = new Dependency(); - _root._singletonValueTuple40 = (perBlockDependency2, perBlockDependency2); - Thread.MemoryBarrier(); - _root._singletonValueTuple40Created = true; - } + Dependency perBlockDependency2 = new Dependency(); + _root._singletonValueTuple40 = (perBlockDependency2, perBlockDependency2); + Thread.MemoryBarrier(); + _root._singletonValueTuple40Created = true; } + } } Dependency perBlockDependency1 = new Dependency(); diff --git a/readme/perresolve.md b/readme/perresolve.md index 840a97e9..bb6c764a 100644 --- a/readme/perresolve.md +++ b/readme/perresolve.md @@ -76,31 +76,31 @@ partial class Composition var perResolveDependency39 = default(Dependency); if (!_root._singletonValueTuple40Created) { - lock (_lock) + lock (_lock) + { + if (!_root._singletonValueTuple40Created) { - if (!_root._singletonValueTuple40Created) - { - if (perResolveDependency39 == null) - { - perResolveDependency39 = new Dependency(); - } - - _root._singletonValueTuple40 = (perResolveDependency39!, perResolveDependency39!); - Thread.MemoryBarrier(); - _root._singletonValueTuple40Created = true; - } + if (perResolveDependency39 == null) + { + perResolveDependency39 = new Dependency(); + } + + _root._singletonValueTuple40 = (perResolveDependency39!, perResolveDependency39!); + Thread.MemoryBarrier(); + _root._singletonValueTuple40Created = true; } + } } if (perResolveDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (perResolveDependency39 == null) { - if (perResolveDependency39 == null) - { - perResolveDependency39 = new Dependency(); - } + perResolveDependency39 = new Dependency(); } + } } return new Service(perResolveDependency39!, perResolveDependency39!, _root._singletonValueTuple40); diff --git a/readme/required-properties-or-fields.md b/readme/required-properties-or-fields.md index 336b204c..781aa1ec 100644 --- a/readme/required-properties-or-fields.md +++ b/readme/required-properties-or-fields.md @@ -71,8 +71,8 @@ partial class Composition { return new Service() { - ServiceNameField = _argName, - Dependency = new Dependency() + ServiceNameField = _argName, + Dependency = new Dependency() }; } } diff --git a/readme/root-binding.md b/readme/root-binding.md index 3a448e71..f5d3e24c 100644 --- a/readme/root-binding.md +++ b/readme/root-binding.md @@ -55,13 +55,13 @@ partial class Composition { if (_root._singletonDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonDependency39 == null) { - if (_root._singletonDependency39 == null) - { - _root._singletonDependency39 = new Dependency(); - } + _root._singletonDependency39 = new Dependency(); } + } } return new Service(_root._singletonDependency39!); diff --git a/readme/scope.md b/readme/scope.md index ca9cfa70..e50d5026 100644 --- a/readme/scope.md +++ b/readme/scope.md @@ -115,14 +115,14 @@ partial class Composition: IDisposable { if (_scopedDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_scopedDependency39 == null) { - if (_scopedDependency39 == null) - { - _scopedDependency39 = new Dependency(); - _disposables[_disposeIndex++] = _scopedDependency39; - } + _scopedDependency39 = new Dependency(); + _disposables[_disposeIndex++] = _scopedDependency39; } + } } return new Service(_scopedDependency39!); @@ -137,20 +137,20 @@ partial class Composition: IDisposable var perResolveFunc47 = default(Func); if (perResolveFunc47 == null) { - lock (_lock) + lock (_lock) + { + if (perResolveFunc47 == null) { - if (perResolveFunc47 == null) - { - perResolveFunc47 = new Func( - [MethodImpl(MethodImplOptions.AggressiveInlining)] - () => - { - Composition transientComposition2 = this; - Session localValue67 = new Session(transientComposition2); - return localValue67; - }); - } + perResolveFunc47 = new Func( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + () => + { + Composition transientComposition2 = this; + Session localValue67 = new Session(transientComposition2); + return localValue67; + }); } + } } return new Program(perResolveFunc47!); diff --git a/readme/service-collection.md b/readme/service-collection.md index 75e5705e..69d5587f 100644 --- a/readme/service-collection.md +++ b/readme/service-collection.md @@ -72,13 +72,13 @@ partial class Composition { if (_root._singletonDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonDependency39 == null) { - if (_root._singletonDependency39 == null) - { - _root._singletonDependency39 = new Dependency(); - } + _root._singletonDependency39 = new Dependency(); } + } } return _root._singletonDependency39!; @@ -92,13 +92,13 @@ partial class Composition { if (_root._singletonDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonDependency39 == null) { - if (_root._singletonDependency39 == null) - { - _root._singletonDependency39 = new Dependency(); - } + _root._singletonDependency39 = new Dependency(); } + } } return new Service(_root._singletonDependency39!); diff --git a/readme/service-provider-with-scope.md b/readme/service-provider-with-scope.md index 1dafd8a3..cfe212bb 100644 --- a/readme/service-provider-with-scope.md +++ b/readme/service-provider-with-scope.md @@ -105,13 +105,13 @@ partial class Composition: IDisposable { if (_root._singletonDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonDependency39 == null) { - if (_root._singletonDependency39 == null) - { - _root._singletonDependency39 = new Dependency(); - } + _root._singletonDependency39 = new Dependency(); } + } } return _root._singletonDependency39!; @@ -125,19 +125,19 @@ partial class Composition: IDisposable { if (_scopedService40 == null) { - lock (_lock) + lock (_lock) + { + if (_scopedService40 == null) { - if (_scopedService40 == null) - { - if (_root._singletonDependency39 == null) - { - _root._singletonDependency39 = new Dependency(); - } - - _scopedService40 = new Service(_root._singletonDependency39!); - _disposables[_disposeIndex++] = _scopedService40; - } + if (_root._singletonDependency39 == null) + { + _root._singletonDependency39 = new Dependency(); + } + + _scopedService40 = new Service(_root._singletonDependency39!); + _disposables[_disposeIndex++] = _scopedService40; } + } } return _scopedService40!; diff --git a/readme/service-provider.md b/readme/service-provider.md index e92d9c35..e4d2536d 100644 --- a/readme/service-provider.md +++ b/readme/service-provider.md @@ -70,13 +70,13 @@ partial class Composition { if (_root._singletonDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonDependency39 == null) { - if (_root._singletonDependency39 == null) - { - _root._singletonDependency39 = new Dependency(); - } + _root._singletonDependency39 = new Dependency(); } + } } return _root._singletonDependency39!; @@ -90,13 +90,13 @@ partial class Composition { if (_root._singletonDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonDependency39 == null) { - if (_root._singletonDependency39 == null) - { - _root._singletonDependency39 = new Dependency(); - } + _root._singletonDependency39 = new Dependency(); } + } } return new Service(_root._singletonDependency39!); diff --git a/readme/simplified-factory.md b/readme/simplified-factory.md index 6a3fded5..326bcba0 100644 --- a/readme/simplified-factory.md +++ b/readme/simplified-factory.md @@ -84,10 +84,10 @@ partial class Composition DateTimeOffset transientDateTimeOffset3 = DateTimeOffset.Now; Dependency transientDependency1; { - Dependency localDependency28 = new Dependency(); - DateTimeOffset localTime29 = transientDateTimeOffset3; - localDependency28.Initialize(localTime29); - transientDependency1 = localDependency28; + Dependency localDependency28 = new Dependency(); + DateTimeOffset localTime29 = transientDateTimeOffset3; + localDependency28.Initialize(localTime29); + transientDependency1 = localDependency28; } return new Service(transientDependency1); diff --git a/readme/singleton.md b/readme/singleton.md index 14273433..fb3a0af9 100644 --- a/readme/singleton.md +++ b/readme/singleton.md @@ -85,13 +85,13 @@ partial class Composition { if (_root._singletonDependency39 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonDependency39 == null) { - if (_root._singletonDependency39 == null) - { - _root._singletonDependency39 = new Dependency(); - } + _root._singletonDependency39 = new Dependency(); } + } } return new Service(_root._singletonDependency39!, _root._singletonDependency39!); diff --git a/readme/span-and-readonlyspan.md b/readme/span-and-readonlyspan.md index 2bbd999b..6cf6c9c2 100644 --- a/readme/span-and-readonlyspan.md +++ b/readme/span-and-readonlyspan.md @@ -69,9 +69,9 @@ partial class Composition { ReadOnlySpan transientReadOnlySpan1 = stackalloc Dependency[3] { - new Dependency(), - new Dependency(), - new Dependency() + new Dependency(), + new Dependency(), + new Dependency() }; return new Service(transientReadOnlySpan1); } diff --git a/readme/tag-on-a-member.md b/readme/tag-on-a-member.md index c86c40f4..2ae1a6b6 100644 --- a/readme/tag-on-a-member.md +++ b/readme/tag-on-a-member.md @@ -67,7 +67,7 @@ partial class Composition { return new Service() { - Dependency = new XyzDependency() + Dependency = new XyzDependency() }; } } diff --git a/readme/tag-on-injection-site-with-wildcards.md b/readme/tag-on-injection-site-with-wildcards.md index 2769985d..83dc5acb 100644 --- a/readme/tag-on-injection-site-with-wildcards.md +++ b/readme/tag-on-injection-site-with-wildcards.md @@ -92,7 +92,7 @@ partial class Composition { return new Service(new XyzDependency(), new XyzDependency(), new Consumer(new AbcDependency())) { - Dependency3 = new AbcDependency() + Dependency3 = new AbcDependency() }; } } diff --git a/readme/tag-type.md b/readme/tag-type.md index c020a33c..a4643470 100644 --- a/readme/tag-type.md +++ b/readme/tag-type.md @@ -85,13 +85,13 @@ partial class Composition { if (_root._singletonXyzDependency40 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonXyzDependency40 == null) { - if (_root._singletonXyzDependency40 == null) - { - _root._singletonXyzDependency40 = new XyzDependency(); - } + _root._singletonXyzDependency40 = new XyzDependency(); } + } } return _root._singletonXyzDependency40!; @@ -105,13 +105,13 @@ partial class Composition { if (_root._singletonXyzDependency40 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonXyzDependency40 == null) { - if (_root._singletonXyzDependency40 == null) - { - _root._singletonXyzDependency40 = new XyzDependency(); - } + _root._singletonXyzDependency40 = new XyzDependency(); } + } } return new Service(new AbcDependency(), _root._singletonXyzDependency40!, new AbcDependency()); diff --git a/readme/tag-unique.md b/readme/tag-unique.md index 1d68233a..6138dbe2 100644 --- a/readme/tag-unique.md +++ b/readme/tag-unique.md @@ -62,8 +62,8 @@ partial class Composition [MethodImpl(MethodImplOptions.AggressiveInlining)] IEnumerable> EnumerationOf_perBlockIEnumerable1() { - yield return new AbcDependency(); - yield return new XyzDependency(); + yield return new AbcDependency(); + yield return new XyzDependency(); } IEnumerable> perBlockIEnumerable1 = EnumerationOf_perBlockIEnumerable1(); diff --git a/readme/tags.md b/readme/tags.md index 7d0f903f..e1bfe69a 100644 --- a/readme/tags.md +++ b/readme/tags.md @@ -89,13 +89,13 @@ partial class Composition { if (_root._singletonXyzDependency40 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonXyzDependency40 == null) { - if (_root._singletonXyzDependency40 == null) - { - _root._singletonXyzDependency40 = new XyzDependency(); - } + _root._singletonXyzDependency40 = new XyzDependency(); } + } } return _root._singletonXyzDependency40!; @@ -109,13 +109,13 @@ partial class Composition { if (_root._singletonXyzDependency40 == null) { - lock (_lock) + lock (_lock) + { + if (_root._singletonXyzDependency40 == null) { - if (_root._singletonXyzDependency40 == null) - { - _root._singletonXyzDependency40 = new XyzDependency(); - } + _root._singletonXyzDependency40 = new XyzDependency(); } + } } return new Service(new AbcDependency(), _root._singletonXyzDependency40!, new AbcDependency()); diff --git a/readme/task.md b/readme/task.md index 747f8ac8..f89e658f 100644 --- a/readme/task.md +++ b/readme/task.md @@ -88,35 +88,35 @@ partial class Composition TaskCreationOptions transientTaskCreationOptions3 = TaskCreationOptions.None; TaskFactory perBlockTaskFactory2; { - CancellationToken localCancellationToken38 = cancellationToken; - TaskCreationOptions localTaskCreationOptions39 = transientTaskCreationOptions3; - TaskContinuationOptions localTaskContinuationOptions40 = transientTaskContinuationOptions4; - TaskScheduler localTaskScheduler41 = transientTaskScheduler5; - perBlockTaskFactory2 = new TaskFactory(localCancellationToken38, localTaskCreationOptions39, localTaskContinuationOptions40, localTaskScheduler41); + CancellationToken localCancellationToken38 = cancellationToken; + TaskCreationOptions localTaskCreationOptions39 = transientTaskCreationOptions3; + TaskContinuationOptions localTaskContinuationOptions40 = transientTaskContinuationOptions4; + TaskScheduler localTaskScheduler41 = transientTaskScheduler5; + perBlockTaskFactory2 = new TaskFactory(localCancellationToken38, localTaskCreationOptions39, localTaskContinuationOptions40, localTaskScheduler41); } if (perResolveFunc45 == null) { - lock (_lock) + lock (_lock) + { + if (perResolveFunc45 == null) { - if (perResolveFunc45 == null) - { - perResolveFunc45 = new Func( - [MethodImpl(MethodImplOptions.AggressiveInlining)] - () => - { - IDependency localValue42 = new Dependency(); - return localValue42; - }); - } + perResolveFunc45 = new Func( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + () => + { + IDependency localValue42 = new Dependency(); + return localValue42; + }); } + } } Task transientTask1; { - Func localFactory43 = perResolveFunc45!; - TaskFactory localTaskFactory44 = perBlockTaskFactory2; - transientTask1 = localTaskFactory44.StartNew(localFactory43); + Func localFactory43 = perResolveFunc45!; + TaskFactory localTaskFactory44 = perBlockTaskFactory2; + transientTask1 = localTaskFactory44.StartNew(localFactory43); } return new Service(transientTask1); diff --git a/readme/tracking-async-disposable-instances-in-delegates.md b/readme/tracking-async-disposable-instances-in-delegates.md index de75f739..994b2a64 100644 --- a/readme/tracking-async-disposable-instances-in-delegates.md +++ b/readme/tracking-async-disposable-instances-in-delegates.md @@ -99,38 +99,38 @@ partial class Composition var perResolveFunc42 = default(Func>); if (perResolveFunc42 == null) { - lock (_lock) + lock (_lock) + { + if (perResolveFunc42 == null) { - if (perResolveFunc42 == null) + perResolveFunc42 = new Func>( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + () => + { + var accumulator41 = new Owned(); + Dependency transientDependency3 = new Dependency(); + lock (_lock) { - perResolveFunc42 = new Func>( - [MethodImpl(MethodImplOptions.AggressiveInlining)] - () => - { - var accumulator41 = new Owned(); - Dependency transientDependency3 = new Dependency(); - lock (_lock) - { - accumulator41.Add(transientDependency3); - } - - Owned perBlockOwned1; - { - Owned localOwned8 = accumulator41; - IDependency localValue9 = transientDependency3; - perBlockOwned1 = new Owned(localValue9, localOwned8); - } - - lock (_lock) - { - accumulator41.Add(perBlockOwned1); - } - - Owned localValue7 = perBlockOwned1; - return localValue7; - }); + accumulator41.Add(transientDependency3); } + + Owned perBlockOwned1; + { + Owned localOwned8 = accumulator41; + IDependency localValue9 = transientDependency3; + perBlockOwned1 = new Owned(localValue9, localOwned8); + } + + lock (_lock) + { + accumulator41.Add(perBlockOwned1); + } + + Owned localValue7 = perBlockOwned1; + return localValue7; + }); } + } } return new Service(perResolveFunc42!); 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 48f1eef4..7640ae7a 100644 --- a/readme/tracking-async-disposable-instances-per-a-composition-root.md +++ b/readme/tracking-async-disposable-instances-per-a-composition-root.md @@ -93,19 +93,19 @@ partial class Composition Dependency transientDependency3 = new Dependency(); lock (_lock) { - accumulator42.Add(transientDependency3); + accumulator42.Add(transientDependency3); } Owned perBlockOwned0; { - Owned localOwned10 = accumulator42; - IService localValue11 = new Service(transientDependency3); - perBlockOwned0 = new Owned(localValue11, localOwned10); + Owned localOwned10 = accumulator42; + IService localValue11 = new Service(transientDependency3); + perBlockOwned0 = new Owned(localValue11, localOwned10); } lock (_lock) { - accumulator42.Add(perBlockOwned0); + accumulator42.Add(perBlockOwned0); } return perBlockOwned0; diff --git a/readme/tracking-disposable-instances-in-delegates.md b/readme/tracking-disposable-instances-in-delegates.md index 33ddc138..287a6763 100644 --- a/readme/tracking-disposable-instances-in-delegates.md +++ b/readme/tracking-disposable-instances-in-delegates.md @@ -92,38 +92,38 @@ partial class Composition var perResolveFunc42 = default(Func>); if (perResolveFunc42 == null) { - lock (_lock) + lock (_lock) + { + if (perResolveFunc42 == null) { - if (perResolveFunc42 == null) + perResolveFunc42 = new Func>( + [MethodImpl(MethodImplOptions.AggressiveInlining)] + () => + { + var accumulator41 = new Owned(); + Dependency transientDependency3 = new Dependency(); + lock (_lock) { - perResolveFunc42 = new Func>( - [MethodImpl(MethodImplOptions.AggressiveInlining)] - () => - { - var accumulator41 = new Owned(); - Dependency transientDependency3 = new Dependency(); - lock (_lock) - { - accumulator41.Add(transientDependency3); - } - - Owned perBlockOwned1; - { - Owned localOwned13 = accumulator41; - IDependency localValue14 = transientDependency3; - perBlockOwned1 = new Owned(localValue14, localOwned13); - } - - lock (_lock) - { - accumulator41.Add(perBlockOwned1); - } - - Owned localValue12 = perBlockOwned1; - return localValue12; - }); + accumulator41.Add(transientDependency3); } + + Owned perBlockOwned1; + { + Owned localOwned13 = accumulator41; + IDependency localValue14 = transientDependency3; + perBlockOwned1 = new Owned(localValue14, localOwned13); + } + + lock (_lock) + { + accumulator41.Add(perBlockOwned1); + } + + Owned localValue12 = perBlockOwned1; + return localValue12; + }); } + } } return new Service(perResolveFunc42!); diff --git a/readme/tracking-disposable-instances-per-a-composition-root.md b/readme/tracking-disposable-instances-per-a-composition-root.md index 3f11f4ad..673771f9 100644 --- a/readme/tracking-disposable-instances-per-a-composition-root.md +++ b/readme/tracking-disposable-instances-per-a-composition-root.md @@ -89,19 +89,19 @@ partial class Composition Dependency transientDependency3 = new Dependency(); lock (_lock) { - accumulator42.Add(transientDependency3); + accumulator42.Add(transientDependency3); } Owned perBlockOwned0; { - Owned localOwned15 = accumulator42; - IService localValue16 = new Service(transientDependency3); - perBlockOwned0 = new Owned(localValue16, localOwned15); + Owned localOwned15 = accumulator42; + IService localValue16 = new Service(transientDependency3); + perBlockOwned0 = new Owned(localValue16, localOwned15); } lock (_lock) { - accumulator42.Add(perBlockOwned0); + accumulator42.Add(perBlockOwned0); } return perBlockOwned0; diff --git a/readme/valuetask.md b/readme/valuetask.md index d3292749..b85fa073 100644 --- a/readme/valuetask.md +++ b/readme/valuetask.md @@ -65,8 +65,8 @@ partial class Composition { ValueTask transientValueTask1; { - IDependency localValue45 = new Dependency(); - transientValueTask1 = new ValueTask(localValue45); + IDependency localValue45 = new Dependency(); + transientValueTask1 = new ValueTask(localValue45); } return new Service(transientValueTask1);