From 0ced977692e013ca8144eea646535d5d143dd69b Mon Sep 17 00:00:00 2001 From: Nikolay Pianikov Date: Tue, 12 Mar 2024 18:58:11 +0300 Subject: [PATCH] Update README.md --- README.md | 1 + readme/ArrayDetails.md | 43 +-- readme/EnumDetails.md | 49 +-- readme/FuncDetails.md | 51 +-- readme/SingletonDetails.md | 57 ++-- readme/TransientDetails.md | 43 +-- readme/a-few-partial-classes.md | 45 +-- readme/advanced-interception.md | 45 +-- readme/arguments.md | 59 ++-- readme/array.md | 45 +-- readme/async-enumerable.md | 51 +-- readme/auto-bindings.md | 6 +- readme/auto-scoped.md | 88 ++--- readme/check-for-a-root.md | 74 ++--- readme/complex-generics.md | 47 +-- readme/composition-root-kinds.md | 56 ++-- readme/composition-roots.md | 99 +++--- readme/constructor-ordinal-attribute.md | 53 +-- readme/custom-attributes.md | 59 ++-- readme/decorator.md | 45 +-- readme/default-lifetime.md | 73 ++--- readme/default-values.md | 45 +-- readme/dependent-compositions.md | 99 +++--- readme/disposable-singleton.md | 81 ++--- readme/enumerable-generics.md | 70 ++-- readme/enumerable.md | 51 +-- readme/factory.md | 55 ++-- readme/field-injection.md | 51 +-- readme/func-with-arguments.md | 73 ++--- readme/func.md | 61 ++-- readme/generic-composition-roots.md | 303 ++++++++++++++++++ readme/generics.md | 45 +-- readme/injection.md | 53 +-- readme/injections-of-abstractions.md | 6 +- readme/instance-initialization.md | 61 ++-- readme/interception.md | 45 +-- readme/keyed-service-provider.md | 114 +++---- readme/lazy.md | 67 ++-- readme/manually-started-tasks.md | 33 +- readme/member-ordinal-attribute.md | 73 ++--- readme/method-injection.md | 51 +-- readme/multi-contract-bindings.md | 45 +-- readme/oncannotresolve-hint.md | 49 +-- readme/ondependencyinjection-hint.md | 45 +-- readme/onnewinstance-hint.md | 75 ++--- readme/overriding-the-bcl-binding.md | 49 +-- readme/partial-class.md | 51 +-- readme/perblock.md | 69 ++-- readme/perresolve.md | 83 ++--- readme/property-injection.md | 51 +-- readme/required-properties-or-fields.md | 53 +-- readme/resolve-hint.md | 12 +- readme/resolve-methods.md | 72 ++--- readme/root-arguments.md | 9 +- readme/scope.md | 100 +++--- readme/service-collection.md | 120 +++---- readme/service-provider-with-scope.md | 144 +++++---- readme/service-provider.md | 118 +++---- readme/simplified-binding.md | 10 +- readme/singleton.md | 65 ++-- readme/span-and-readonlyspan.md | 49 +-- readme/tag-attribute.md | 45 +-- readme/tag-type.md | 87 ++--- readme/tag-unique.md | 71 ++-- readme/tags.md | 87 ++--- readme/task.md | 51 +-- readme/threadsafe-hint.md | 45 +-- readme/tostring-hint.md | 45 +-- readme/tracking-disposable-instances.md | 55 ++-- readme/transient.md | 45 +-- readme/tuple.md | 49 +-- readme/type-attribute.md | 45 +-- readme/valuetask.md | 53 +-- readme/weak-reference.md | 45 +-- ...cs => GenericsCompositionRootsScenario.cs} | 4 +- .../Basics/GenericsScenario.cs | 7 +- 76 files changed, 2452 insertions(+), 2077 deletions(-) create mode 100644 readme/generic-composition-roots.md rename tests/Pure.DI.UsageTests/Basics/{GenericCompositionRootsScenario.cs => GenericsCompositionRootsScenario.cs} (96%) diff --git a/README.md b/README.md index 0799eb523..07e5bda35 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,7 @@ dotnet run - [Simplified binding](readme/simplified-binding.md) - [Factory](readme/factory.md) - [Injection](readme/injection.md) +- [Generic composition roots](readme/generic-composition-roots.md) - [Generics](readme/generics.md) - [Arguments](readme/arguments.md) - [Root arguments](readme/root-arguments.md) diff --git a/readme/ArrayDetails.md b/readme/ArrayDetails.md index ca36d07e4..4c330fa77 100644 --- a/readme/ArrayDetails.md +++ b/readme/ArrayDetails.md @@ -98,6 +98,7 @@ classDiagram /// PureDIByCR /// /// +/// Provides a composition root of type . /// /// /// @@ -116,14 +117,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Array { - private readonly Array _rootM03D11di; + private readonly Array _rootM03D12di; /// /// This constructor creates a new instance of . /// public Array() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -132,7 +133,7 @@ partial class Array /// Base composition. internal Array(Array baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -156,7 +157,7 @@ partial class Array #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -170,7 +171,7 @@ partial class Array #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -183,10 +184,10 @@ partial class Array #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -207,10 +208,10 @@ partial class Array #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -303,26 +304,26 @@ partial class Array " Array ..> CompositionRoot : CompositionRoot PureDIByCR"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Array() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Array composite) { @@ -335,7 +336,7 @@ partial class Array } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.Benchmarks.Model.CompositionRoot Resolve(Array composition) { diff --git a/readme/EnumDetails.md b/readme/EnumDetails.md index e0c12edbd..318e41702 100644 --- a/readme/EnumDetails.md +++ b/readme/EnumDetails.md @@ -98,6 +98,7 @@ classDiagram /// PureDIByCR /// /// +/// Provides a composition root of type . /// /// /// @@ -116,14 +117,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Enum { - private readonly Enum _rootM03D11di; + private readonly Enum _rootM03D12di; /// /// This constructor creates a new instance of . /// public Enum() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -132,7 +133,7 @@ partial class Enum /// Base composition. internal Enum(Enum baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -142,15 +143,15 @@ partial class Enum public partial Pure.DI.Benchmarks.Model.CompositionRoot PureDIByCR() { [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)0x200)] - System.Collections.Generic.IEnumerable LocalperBlockM03D11di10_IEnumerable() + System.Collections.Generic.IEnumerable LocalperBlockM03D12di10_IEnumerable() { yield return new Pure.DI.Benchmarks.Model.Service3(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()); yield return new Pure.DI.Benchmarks.Model.Service3v2(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()); yield return new Pure.DI.Benchmarks.Model.Service3v3(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()); yield return new Pure.DI.Benchmarks.Model.Service3v4(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()); } - var perBlockM03D11di10_IEnumerable = LocalperBlockM03D11di10_IEnumerable(); - return new Pure.DI.Benchmarks.Model.CompositionRoot(new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D11di10_IEnumerable)), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D11di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D11di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D11di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service3(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()), new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()); + var perBlockM03D12di10_IEnumerable = LocalperBlockM03D12di10_IEnumerable(); + return new Pure.DI.Benchmarks.Model.CompositionRoot(new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D12di10_IEnumerable)), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D12di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D12di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D12di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service3(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()), new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()); } #endregion @@ -165,7 +166,7 @@ partial class Enum #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -179,7 +180,7 @@ partial class Enum #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -192,10 +193,10 @@ partial class Enum #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -216,10 +217,10 @@ partial class Enum #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -312,26 +313,26 @@ partial class Enum " Enum ..> CompositionRoot : CompositionRoot PureDIByCR"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Enum() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Enum composite) { @@ -344,7 +345,7 @@ partial class Enum } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.Benchmarks.Model.CompositionRoot Resolve(Enum composition) { diff --git a/readme/FuncDetails.md b/readme/FuncDetails.md index ac1d0dcba..f9b3249ec 100644 --- a/readme/FuncDetails.md +++ b/readme/FuncDetails.md @@ -77,6 +77,7 @@ classDiagram /// PureDIByCR /// /// +/// Provides a composition root of type . /// /// /// @@ -95,14 +96,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Func { - private readonly Func _rootM03D11di; + private readonly Func _rootM03D12di; /// /// This constructor creates a new instance of . /// public Func() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -111,7 +112,7 @@ partial class Func /// Base composition. internal Func(Func baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -120,14 +121,14 @@ partial class Func #endif public partial Pure.DI.Benchmarks.Model.CompositionRoot PureDIByCR() { - System.Func perBlockM03D11di10_Func = new Func( + System.Func perBlockM03D12di10_Func = new Func( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - var value_M03D11di1 = new Pure.DI.Benchmarks.Model.Service3(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()); - return value_M03D11di1; + var value_M03D12di1 = new Pure.DI.Benchmarks.Model.Service3(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()); + return value_M03D12di1; }); - return new Pure.DI.Benchmarks.Model.CompositionRoot(new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D11di10_Func)), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D11di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D11di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D11di10_Func), new Pure.DI.Benchmarks.Model.Service3(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()), new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()); + return new Pure.DI.Benchmarks.Model.CompositionRoot(new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D12di10_Func)), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D12di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D12di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D12di10_Func), new Pure.DI.Benchmarks.Model.Service3(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()), new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()); } #endregion @@ -142,7 +143,7 @@ partial class Func #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -156,7 +157,7 @@ partial class Func #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -169,10 +170,10 @@ partial class Func #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -193,10 +194,10 @@ partial class Func #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -268,26 +269,26 @@ partial class Func " FuncᐸIService3ᐳ *-- Service3 : IService3"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Func() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Func composite) { @@ -300,7 +301,7 @@ partial class Func } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.Benchmarks.Model.CompositionRoot Resolve(Func composition) { diff --git a/readme/SingletonDetails.md b/readme/SingletonDetails.md index 5bfb8c735..102909a98 100644 --- a/readme/SingletonDetails.md +++ b/readme/SingletonDetails.md @@ -79,6 +79,7 @@ classDiagram /// PureDIByCR /// /// +/// Provides a composition root of type . /// /// /// @@ -97,16 +98,16 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Singleton { - private readonly Singleton _rootM03D11di; - private Pure.DI.Benchmarks.Model.Service1 _scopedM03D11di35_Service1; - private Pure.DI.Benchmarks.Model.Service4 _scopedM03D11di38_Service4; + private readonly Singleton _rootM03D12di; + private Pure.DI.Benchmarks.Model.Service1 _scopedM03D12di35_Service1; + private Pure.DI.Benchmarks.Model.Service4 _scopedM03D12di38_Service4; /// /// This constructor creates a new instance of . /// public Singleton() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -115,7 +116,7 @@ partial class Singleton /// Base composition. internal Singleton(Singleton baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -124,15 +125,15 @@ partial class Singleton #endif public partial Pure.DI.Benchmarks.Model.CompositionRoot PureDIByCR() { - if (ReferenceEquals(_scopedM03D11di38_Service4, null)) + if (ReferenceEquals(_scopedM03D12di38_Service4, null)) { - _scopedM03D11di38_Service4 = new Pure.DI.Benchmarks.Model.Service4(); + _scopedM03D12di38_Service4 = new Pure.DI.Benchmarks.Model.Service4(); } - if (ReferenceEquals(_scopedM03D11di35_Service1, null)) + if (ReferenceEquals(_scopedM03D12di35_Service1, null)) { - _scopedM03D11di35_Service1 = new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4))); + _scopedM03D12di35_Service1 = new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4))); } - return new Pure.DI.Benchmarks.Model.CompositionRoot(_scopedM03D11di35_Service1, new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4)), new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4)), new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4)), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D11di38_Service4, _scopedM03D11di38_Service4), _scopedM03D11di38_Service4, _scopedM03D11di38_Service4); + return new Pure.DI.Benchmarks.Model.CompositionRoot(_scopedM03D12di35_Service1, new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4)), new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4)), new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4)), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D12di38_Service4, _scopedM03D12di38_Service4), _scopedM03D12di38_Service4, _scopedM03D12di38_Service4); } #endregion @@ -147,7 +148,7 @@ partial class Singleton #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -161,7 +162,7 @@ partial class Singleton #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -174,10 +175,10 @@ partial class Singleton #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -198,10 +199,10 @@ partial class Singleton #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -275,26 +276,26 @@ partial class Singleton " Singleton ..> CompositionRoot : CompositionRoot PureDIByCR"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Singleton() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Singleton composite) { @@ -307,7 +308,7 @@ partial class Singleton } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.Benchmarks.Model.CompositionRoot Resolve(Singleton composition) { diff --git a/readme/TransientDetails.md b/readme/TransientDetails.md index 1664bf0eb..75155667a 100644 --- a/readme/TransientDetails.md +++ b/readme/TransientDetails.md @@ -79,6 +79,7 @@ classDiagram /// PureDIByCR /// /// +/// Provides a composition root of type . /// /// /// @@ -97,14 +98,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Transient { - private readonly Transient _rootM03D11di; + private readonly Transient _rootM03D12di; /// /// This constructor creates a new instance of . /// public Transient() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -113,7 +114,7 @@ partial class Transient /// Base composition. internal Transient(Transient baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -137,7 +138,7 @@ partial class Transient #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -151,7 +152,7 @@ partial class Transient #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -164,10 +165,10 @@ partial class Transient #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -188,10 +189,10 @@ partial class Transient #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -265,26 +266,26 @@ partial class Transient " Transient ..> CompositionRoot : CompositionRoot PureDIByCR"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Transient() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Transient composite) { @@ -297,7 +298,7 @@ partial class Transient } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.Benchmarks.Model.CompositionRoot Resolve(Transient composition) { diff --git a/readme/a-few-partial-classes.md b/readme/a-few-partial-classes.md index 00b015c5e..1edecb027 100644 --- a/readme/a-few-partial-classes.md +++ b/readme/a-few-partial-classes.md @@ -86,9 +86,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -107,14 +108,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -123,7 +124,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -150,7 +151,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -164,7 +165,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -177,10 +178,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -201,10 +202,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -247,26 +248,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.SeveralPartialClassesScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.SeveralPartialClassesScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -279,7 +280,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.SeveralPartialClassesScenario.IService Resolve(Composition composition) { diff --git a/readme/advanced-interception.md b/readme/advanced-interception.md index 7a0ce3b0a..d7a523006 100644 --- a/readme/advanced-interception.md +++ b/readme/advanced-interception.md @@ -154,9 +154,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -175,14 +176,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -191,7 +192,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -218,7 +219,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -232,7 +233,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -245,10 +246,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -269,10 +270,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -317,26 +318,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Interception.AdvancedInterceptionScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Interception.AdvancedInterceptionScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -349,7 +350,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Interception.AdvancedInterceptionScenario.IService Resolve(Composition composition) { diff --git a/readme/arguments.md b/readme/arguments.md index 101eb9813..4dbb16b17 100644 --- a/readme/arguments.md +++ b/readme/arguments.md @@ -99,9 +99,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -120,9 +121,9 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly int _argM03D11di_id; - private readonly string _argM03D11di_serviceName; + private readonly Composition _rootM03D12di; + private readonly int _argM03D12di_id; + private readonly string _argM03D12di_serviceName; /// /// This parameterized constructor creates a new instance of with arguments. @@ -136,14 +137,14 @@ partial class Composition /// public Composition(int id, string serviceName) { - _rootM03D11di = this; + _rootM03D12di = this; if (ReferenceEquals(serviceName, null)) { throw new global::System.ArgumentNullException("serviceName"); } - _argM03D11di_id = id; - _argM03D11di_serviceName = serviceName; + _argM03D12di_id = id; + _argM03D12di_serviceName = serviceName; } /// @@ -152,9 +153,9 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _argM03D11di_id = baseComposition._argM03D11di_id; - _argM03D11di_serviceName = baseComposition._argM03D11di_serviceName; + _rootM03D12di = baseComposition._rootM03D12di; + _argM03D12di_id = baseComposition._argM03D12di_id; + _argM03D12di_serviceName = baseComposition._argM03D12di_serviceName; } #region Composition Roots @@ -165,7 +166,7 @@ partial class Composition #endif get { - return new Pure.DI.UsageTests.Basics.ArgumentsScenario.Service(_argM03D11di_serviceName, new Pure.DI.UsageTests.Basics.ArgumentsScenario.Dependency(_argM03D11di_id)); + return new Pure.DI.UsageTests.Basics.ArgumentsScenario.Service(_argM03D12di_serviceName, new Pure.DI.UsageTests.Basics.ArgumentsScenario.Dependency(_argM03D12di_id)); } } #endregion @@ -181,7 +182,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -195,7 +196,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -208,10 +209,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -232,10 +233,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -282,26 +283,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ArgumentsScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ArgumentsScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -314,7 +315,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.ArgumentsScenario.IService Resolve(Composition composition) { diff --git a/readme/array.md b/readme/array.md index 57efc61ef..58c49d3af 100644 --- a/readme/array.md +++ b/readme/array.md @@ -111,9 +111,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -132,14 +133,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -148,7 +149,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -175,7 +176,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -189,7 +190,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -202,10 +203,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -226,10 +227,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -279,26 +280,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ArrayScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ArrayScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -311,7 +312,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.ArrayScenario.IService Resolve(Composition composition) { diff --git a/readme/async-enumerable.md b/readme/async-enumerable.md index 7275c978f..d1bee026c 100644 --- a/readme/async-enumerable.md +++ b/readme/async-enumerable.md @@ -94,9 +94,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -115,14 +116,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -131,7 +132,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -143,13 +144,13 @@ partial class Composition get { [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)0x200)] - async System.Collections.Generic.IAsyncEnumerable LocaltransientM03D11di1_IAsyncEnumerable() + async System.Collections.Generic.IAsyncEnumerable LocaltransientM03D12di1_IAsyncEnumerable() { yield return new Pure.DI.UsageTests.BCL.AsyncEnumerableScenario.AbcDependency(); yield return new Pure.DI.UsageTests.BCL.AsyncEnumerableScenario.XyzDependency(); } - var transientM03D11di1_IAsyncEnumerable = LocaltransientM03D11di1_IAsyncEnumerable(); - return new Pure.DI.UsageTests.BCL.AsyncEnumerableScenario.Service(transientM03D11di1_IAsyncEnumerable); + var transientM03D12di1_IAsyncEnumerable = LocaltransientM03D12di1_IAsyncEnumerable(); + return new Pure.DI.UsageTests.BCL.AsyncEnumerableScenario.Service(transientM03D12di1_IAsyncEnumerable); } } #endregion @@ -165,7 +166,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -179,7 +180,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -192,10 +193,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -216,10 +217,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -269,26 +270,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.AsyncEnumerableScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.AsyncEnumerableScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -301,7 +302,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.AsyncEnumerableScenario.IService Resolve(Composition composition) { diff --git a/readme/auto-bindings.md b/readme/auto-bindings.md index 18c52612c..46ab27e35 100644 --- a/readme/auto-bindings.md +++ b/readme/auto-bindings.md @@ -82,14 +82,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -98,7 +98,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots diff --git a/readme/auto-scoped.md b/readme/auto-scoped.md index a769714df..8457660fd 100644 --- a/readme/auto-scoped.md +++ b/readme/auto-scoped.md @@ -142,17 +142,17 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; - private Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Dependency _scopedM03D11di34_Dependency; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; + private Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Dependency _scopedM03D12di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -161,8 +161,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots @@ -176,17 +176,17 @@ partial class Composition #endif get { - if (ReferenceEquals(_scopedM03D11di34_Dependency, null)) + if (ReferenceEquals(_scopedM03D12di34_Dependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_scopedM03D11di34_Dependency, null)) + if (ReferenceEquals(_scopedM03D12di34_Dependency, null)) { - _scopedM03D11di34_Dependency = new Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Dependency(); + _scopedM03D12di34_Dependency = new Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Dependency(); } } } - return new Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Service(_scopedM03D11di34_Dependency); + return new Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Service(_scopedM03D12di34_Dependency); } } @@ -200,23 +200,23 @@ partial class Composition #endif get { - var perResolveM03D11di39_Func = default(System.Func); - perResolveM03D11di39_Func = new global::System.Func( + var perResolveM03D12di39_Func = default(System.Func); + perResolveM03D12di39_Func = new global::System.Func( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - var transientM03D11di2_Composition = this; - Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.IService transientM03D11di1_IService; + var transientM03D12di2_Composition = this; + Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.IService transientM03D12di1_IService; { - var baseComposition_M03D11di2 = transientM03D11di2_Composition; + var baseComposition_M03D12di2 = transientM03D12di2_Composition; // Creates a session - var session_M03D11di3 = new Composition(baseComposition_M03D11di2); - transientM03D11di1_IService = session_M03D11di3.SessionRoot; + var session_M03D12di3 = new Composition(baseComposition_M03D12di2); + transientM03D12di1_IService = session_M03D12di3.SessionRoot; } - var factory_M03D11di1 = transientM03D11di1_IService; - return factory_M03D11di1; + var factory_M03D12di1 = transientM03D12di1_IService; + return factory_M03D12di1; }); - return new Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Program(perResolveM03D11di39_Func); + return new Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Program(perResolveM03D12di39_Func); } } #endregion @@ -232,7 +232,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -246,7 +246,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -259,10 +259,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -283,10 +283,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -336,29 +336,29 @@ partial class Composition " FuncᐸIServiceᐳ *-- IService : IService"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - var valResolverM03D11di_0001 = new ResolverM03D11di_0001(); - ResolverM03D11di.Value = valResolverM03D11di_0001; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + var valResolverM03D12di_0001 = new ResolverM03D12di_0001(); + ResolverM03D12di.Value = valResolverM03D12di_0001; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Service), valResolverM03D11di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Program), valResolverM03D11di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Service), valResolverM03D12di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Program), valResolverM03D12di_0001) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -371,7 +371,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Service Resolve(Composition composition) { @@ -389,7 +389,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Program Resolve(Composition composition) { diff --git a/readme/check-for-a-root.md b/readme/check-for-a-root.md index fea5705f0..680353d6e 100644 --- a/readme/check-for-a-root.md +++ b/readme/check-for-a-root.md @@ -64,7 +64,7 @@ Composition.HasRoot(typeof(IComparable)).ShouldBeFalse(); classDiagram class Composition { +IService Root - -IDependency RootM03D11di0001 + -IDependency RootM03D12di0001 + T ResolveᐸTᐳ() + T ResolveᐸTᐳ(object? tag) + object Resolve(Type type) @@ -86,7 +86,7 @@ classDiagram <> } Service *-- Dependency : "MyDep" IDependency - Composition ..> Dependency : "MyDep" IDependency RootM03D11di0001 + Composition ..> Dependency : "MyDep" IDependency RootM03D12di0001 Composition ..> Service : IService Root ``` @@ -105,16 +105,18 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// /// -/// is a private composition root that can be resolved by methods like . +/// is a private composition root that can be resolved by methods like . /// /// +/// Provides a composition root of type . /// /// /// @@ -126,21 +128,21 @@ classDiagram /// var instance = composition.Root; /// /// -/// Class diagram
+/// Class diagram
/// This class was created by Pure.DI source code generator. ///
/// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -149,7 +151,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -167,7 +169,7 @@ partial class Composition } } - public Pure.DI.UsageTests.Basics.CheckForRootScenario.IDependency RootM03D11di0001 + public Pure.DI.UsageTests.Basics.CheckForRootScenario.IDependency RootM03D12di0001 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] @@ -190,7 +192,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -204,7 +206,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -217,10 +219,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -241,10 +243,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -264,7 +266,7 @@ partial class Composition "classDiagram\n" + " class Composition {\n" + " +IService Root\n" + - " -IDependency RootM03D11di0001\n" + + " -IDependency RootM03D12di0001\n" + " + T ResolveᐸTᐳ()\n" + " + T ResolveᐸTᐳ(object? tag)\n" + " + object Resolve(Type type)\n" + @@ -286,37 +288,37 @@ partial class Composition " <>\n" + " }\n" + " Service *-- Dependency : \"MyDep\" IDependency\n" + - " Composition ..> Dependency : \"MyDep\" IDependency RootM03D11di0001\n" + + " Composition ..> Dependency : \"MyDep\" IDependency RootM03D12di0001\n" + " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; private static partial void OnNewRoot(global::Pure.DI.IResolver resolver, string name, object? tag, global::Pure.DI.Lifetime lifetime); static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - OnNewRoot(valResolverM03D11di_0000, "Root", null, Pure.DI.Lifetime.Transient); - ResolverM03D11di.Value = valResolverM03D11di_0000; - var valResolverM03D11di_0001 = new ResolverM03D11di_0001(); - OnNewRoot(valResolverM03D11di_0001, "RootM03D11di0001", "MyDep", Pure.DI.Lifetime.Transient); - ResolverM03D11di.Value = valResolverM03D11di_0001; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + OnNewRoot(valResolverM03D12di_0000, "Root", null, Pure.DI.Lifetime.Transient); + ResolverM03D12di.Value = valResolverM03D12di_0000; + var valResolverM03D12di_0001 = new ResolverM03D12di_0001(); + OnNewRoot(valResolverM03D12di_0001, "RootM03D12di0001", "MyDep", Pure.DI.Lifetime.Transient); + ResolverM03D12di.Value = valResolverM03D12di_0001; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CheckForRootScenario.IService), valResolverM03D11di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CheckForRootScenario.IDependency), valResolverM03D11di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CheckForRootScenario.IService), valResolverM03D12di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CheckForRootScenario.IDependency), valResolverM03D12di_0001) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -329,7 +331,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.CheckForRootScenario.IService Resolve(Composition composition) { @@ -347,7 +349,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.CheckForRootScenario.IDependency Resolve(Composition composition) { @@ -359,7 +361,7 @@ partial class Composition switch (tag) { case "MyDep": - return composition.RootM03D11di0001; + return composition.RootM03D12di0001; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.CheckForRootScenario.IDependency."); } diff --git a/readme/complex-generics.md b/readme/complex-generics.md index 1b7b7ba14..b9ec48f6b 100644 --- a/readme/complex-generics.md +++ b/readme/complex-generics.md @@ -115,15 +115,16 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// /// /// -/// This shows how to get an instance of type using the composition root : +/// This shows how to get an instance of type using the composition root : /// /// var composition = new Composition(); /// var instance = composition.Root; @@ -136,14 +137,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -152,7 +153,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -179,7 +180,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -193,7 +194,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -206,10 +207,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -230,10 +231,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -288,26 +289,26 @@ partial class Composition " ServiceᐸStringˏInt32ˏListᐸStringᐳˏDictionaryᐸStringˏInt32ᐳᐳ *-- DependencyStructᐸInt32ᐳ : \"value type\" IDependencyᐸInt32ᐳ"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di>.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di>.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ComplexGenericsScenario.Program), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ComplexGenericsScenario.Program), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -320,7 +321,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver> + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver> { public Pure.DI.UsageTests.Basics.ComplexGenericsScenario.Program Resolve(Composition composition) { diff --git a/readme/composition-root-kinds.md b/readme/composition-root-kinds.md index 3a0b8566f..ae90bf3a1 100644 --- a/readme/composition-root-kinds.md +++ b/readme/composition-root-kinds.md @@ -94,7 +94,7 @@ classDiagram /// /// /// -/// Dependency +/// Dependency /// /// /// Creates a internal static root named "Dependency" @@ -102,7 +102,7 @@ classDiagram /// /// /// -/// GetOtherService +/// GetOtherService /// /// /// Creates a public root method named "GetOtherService" @@ -110,7 +110,7 @@ classDiagram /// /// /// -/// GetRoot +/// GetRoot /// /// /// Creates a private partial root method named "GetRoot" @@ -132,14 +132,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -148,7 +148,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -200,7 +200,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -214,7 +214,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -227,10 +227,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -251,10 +251,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -305,29 +305,29 @@ partial class Composition " Composition ..> Dependency : IDependency Dependency"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - var valResolverM03D11di_0001 = new ResolverM03D11di_0001(); - ResolverM03D11di.Value = valResolverM03D11di_0001; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + var valResolverM03D12di_0001 = new ResolverM03D12di_0001(); + ResolverM03D12di.Value = valResolverM03D12di_0001; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootKindsScenario.IService), valResolverM03D11di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootKindsScenario.IDependency), valResolverM03D11di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootKindsScenario.IService), valResolverM03D12di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootKindsScenario.IDependency), valResolverM03D12di_0001) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -340,7 +340,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.CompositionRootKindsScenario.IService Resolve(Composition composition) { @@ -360,7 +360,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.CompositionRootKindsScenario.IDependency Resolve(Composition composition) { diff --git a/readme/composition-roots.md b/readme/composition-roots.md index 83ca2d09b..2d4e633d7 100644 --- a/readme/composition-roots.md +++ b/readme/composition-roots.md @@ -17,18 +17,21 @@ class OtherService : IService; DI.Setup(nameof(Composition)) .Bind().To() - // Specifies to create a regular public composition root - // of type "IService" with the name "MyRoot" - .Root("MyRoot") .Bind("Other").To() - // Specifies to create a regular public composition root - // of type "IService" with the name "SomeOtherService" - // using the "Other" tag - .Root("SomeOtherService", "Other") .Bind().To() - // Specifies to create a private composition root - // that is only accessible from "Resolve()" methods - .Root(); + + // Specifies to create a regular public composition root + // of type "IService" with the name "SomeOtherService" + // using the "Other" tag + .Root("SomeOtherService", "Other") + + // Specifies to create a regular public composition root + // of type "IService" with the name "MyRoot" + .Root("MyRoot") + + // Specifies to create a private composition root + // that is only accessible from "Resolve()" methods + .Root(); var composition = new Composition(); @@ -68,7 +71,7 @@ classDiagram class Composition { +IService MyRoot +IService SomeOtherService - -IDependency RootM03D11di0003 + -IDependency RootM03D12di0003 + T ResolveᐸTᐳ() + T ResolveᐸTᐳ(object? tag) + object Resolve(Type type) @@ -93,9 +96,9 @@ classDiagram <> } Service *-- Dependency : IDependency - Composition ..> Service : IService MyRoot Composition ..> OtherService : "Other" IService SomeOtherService - Composition ..> Dependency : IDependency RootM03D11di0003 + Composition ..> Service : IService MyRoot + Composition ..> Dependency : IDependency RootM03D12di0003 ``` @@ -113,7 +116,7 @@ classDiagram /// /// /// -/// MyRoot +/// MyRoot /// /// /// Specifies to create a regular public composition root
@@ -122,7 +125,7 @@ classDiagram ///
/// /// -/// SomeOtherService +/// SomeOtherService /// /// /// Specifies to create a regular public composition root
@@ -132,7 +135,7 @@ classDiagram ///
/// /// -/// is a private composition root that can be resolved by methods like . +/// is a private composition root that can be resolved by methods like . /// /// /// Specifies to create a private composition root
@@ -148,21 +151,21 @@ classDiagram /// var instance = composition.MyRoot; ///
/// -/// Class diagram
+/// Class diagram
/// This class was created by Pure.DI source code generator. ///
/// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -171,7 +174,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -210,7 +213,7 @@ partial class Composition /// Specifies to create a private composition root
/// that is only accessible from "Resolve()" methods ///
- public Pure.DI.UsageTests.Basics.CompositionRootsScenario.IDependency RootM03D11di0003 + public Pure.DI.UsageTests.Basics.CompositionRootsScenario.IDependency RootM03D12di0003 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] @@ -233,7 +236,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -247,7 +250,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -260,10 +263,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -284,10 +287,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -308,7 +311,7 @@ partial class Composition " class Composition {\n" + " +IService MyRoot\n" + " +IService SomeOtherService\n" + - " -IDependency RootM03D11di0003\n" + + " -IDependency RootM03D12di0003\n" + " + T ResolveᐸTᐳ()\n" + " + T ResolveᐸTᐳ(object? tag)\n" + " + object Resolve(Type type)\n" + @@ -333,34 +336,34 @@ partial class Composition " <>\n" + " }\n" + " Service *-- Dependency : IDependency\n" + - " Composition ..> Service : IService MyRoot\n" + " Composition ..> OtherService : \"Other\" IService SomeOtherService\n" + - " Composition ..> Dependency : IDependency RootM03D11di0003"; + " Composition ..> Service : IService MyRoot\n" + + " Composition ..> Dependency : IDependency RootM03D12di0003"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - var valResolverM03D11di_0001 = new ResolverM03D11di_0001(); - ResolverM03D11di.Value = valResolverM03D11di_0001; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + var valResolverM03D12di_0001 = new ResolverM03D12di_0001(); + ResolverM03D12di.Value = valResolverM03D12di_0001; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootsScenario.IService), valResolverM03D11di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootsScenario.IDependency), valResolverM03D11di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootsScenario.IService), valResolverM03D12di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootsScenario.IDependency), valResolverM03D12di_0001) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -373,7 +376,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.CompositionRootsScenario.IService Resolve(Composition composition) { @@ -393,11 +396,11 @@ partial class Composition } } - private sealed class ResolverM03D11di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.CompositionRootsScenario.IDependency Resolve(Composition composition) { - return composition.RootM03D11di0003; + return composition.RootM03D12di0003; } public Pure.DI.UsageTests.Basics.CompositionRootsScenario.IDependency ResolveByTag(Composition composition, object tag) @@ -405,7 +408,7 @@ partial class Composition switch (tag) { case null: - return composition.RootM03D11di0003; + return composition.RootM03D12di0003; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.CompositionRootsScenario.IDependency."); } diff --git a/readme/constructor-ordinal-attribute.md b/readme/constructor-ordinal-attribute.md index f287d9dad..fc530659b 100644 --- a/readme/constructor-ordinal-attribute.md +++ b/readme/constructor-ordinal-attribute.md @@ -78,9 +78,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -99,8 +100,8 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly string _argM03D11di_serviceName; + private readonly Composition _rootM03D12di; + private readonly string _argM03D12di_serviceName; /// /// This parameterized constructor creates a new instance of with arguments. @@ -108,13 +109,13 @@ partial class Composition /// The composition argument of type . public Composition(string serviceName) { - _rootM03D11di = this; + _rootM03D12di = this; if (ReferenceEquals(serviceName, null)) { throw new global::System.ArgumentNullException("serviceName"); } - _argM03D11di_serviceName = serviceName; + _argM03D12di_serviceName = serviceName; } /// @@ -123,8 +124,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _argM03D11di_serviceName = baseComposition._argM03D11di_serviceName; + _rootM03D12di = baseComposition._rootM03D12di; + _argM03D12di_serviceName = baseComposition._argM03D12di_serviceName; } #region Composition Roots @@ -135,7 +136,7 @@ partial class Composition #endif get { - return new Pure.DI.UsageTests.Attributes.ConstructorOrdinalAttributeScenario.Service(_argM03D11di_serviceName); + return new Pure.DI.UsageTests.Attributes.ConstructorOrdinalAttributeScenario.Service(_argM03D12di_serviceName); } } #endregion @@ -151,7 +152,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -165,7 +166,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -178,10 +179,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -202,10 +203,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -242,26 +243,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.ConstructorOrdinalAttributeScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.ConstructorOrdinalAttributeScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -274,7 +275,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Attributes.ConstructorOrdinalAttributeScenario.IService Resolve(Composition composition) { diff --git a/readme/custom-attributes.md b/readme/custom-attributes.md index 6f2b3379f..073c1743a 100644 --- a/readme/custom-attributes.md +++ b/readme/custom-attributes.md @@ -94,9 +94,10 @@ classDiagram /// /// /// -/// Person +/// Person /// /// +/// Provides a composition root of type . /// /// /// @@ -115,8 +116,8 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class PersonComposition { - private readonly PersonComposition _rootM03D11di; - private readonly int _argM03D11di_personId; + private readonly PersonComposition _rootM03D12di; + private readonly int _argM03D12di_personId; /// /// This parameterized constructor creates a new instance of with arguments. @@ -124,8 +125,8 @@ partial class PersonComposition /// The composition argument of type . public PersonComposition(int personId) { - _rootM03D11di = this; - _argM03D11di_personId = personId; + _rootM03D12di = this; + _argM03D12di_personId = personId; } /// @@ -134,8 +135,8 @@ partial class PersonComposition /// Base composition. internal PersonComposition(PersonComposition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _argM03D11di_personId = baseComposition._argM03D11di_personId; + _rootM03D12di = baseComposition._rootM03D12di; + _argM03D12di_personId = baseComposition._argM03D12di_personId; } #region Composition Roots @@ -146,10 +147,10 @@ partial class PersonComposition #endif get { - string transientM03D11di1_String = "Nik"; - var transientM03D11di0_Person = new Pure.DI.UsageTests.Attributes.CustomAttributesScenario.Person(transientM03D11di1_String); - transientM03D11di0_Person.Id = _argM03D11di_personId; - return transientM03D11di0_Person; + string transientM03D12di1_String = "Nik"; + var transientM03D12di0_Person = new Pure.DI.UsageTests.Attributes.CustomAttributesScenario.Person(transientM03D12di1_String); + transientM03D12di0_Person.Id = _argM03D12di_personId; + return transientM03D12di0_Person; } } #endregion @@ -165,7 +166,7 @@ partial class PersonComposition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -179,7 +180,7 @@ partial class PersonComposition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -192,10 +193,10 @@ partial class PersonComposition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -216,10 +217,10 @@ partial class PersonComposition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -259,26 +260,26 @@ partial class PersonComposition " PersonComposition ..> Person : IPerson Person"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static PersonComposition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.CustomAttributesScenario.IPerson), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.CustomAttributesScenario.IPerson), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(PersonComposition composite) { @@ -291,7 +292,7 @@ partial class PersonComposition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Attributes.CustomAttributesScenario.IPerson Resolve(PersonComposition composition) { diff --git a/readme/decorator.md b/readme/decorator.md index 028939d35..99f48f20e 100644 --- a/readme/decorator.md +++ b/readme/decorator.md @@ -71,9 +71,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -92,14 +93,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -108,7 +109,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -135,7 +136,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -149,7 +150,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -162,10 +163,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -186,10 +187,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -229,26 +230,26 @@ partial class Composition " Composition ..> GreetingService : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Interception.DecoratorScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Interception.DecoratorScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -261,7 +262,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Interception.DecoratorScenario.IService Resolve(Composition composition) { diff --git a/readme/default-lifetime.md b/readme/default-lifetime.md index 5da3fb6d7..97d4ae6cf 100644 --- a/readme/default-lifetime.md +++ b/readme/default-lifetime.md @@ -84,9 +84,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -105,18 +106,18 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; - private Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Service _singletonM03D11di35_Service; - private Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Dependency _singletonM03D11di34_Dependency; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; + private Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Service _singletonM03D12di35_Service; + private Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Dependency _singletonM03D12di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -125,8 +126,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots @@ -137,23 +138,23 @@ partial class Composition #endif get { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di35_Service, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di35_Service, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di35_Service, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di35_Service, null)) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - _singletonM03D11di34_Dependency = new Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Dependency(); - _rootM03D11di._singletonM03D11di34_Dependency = _singletonM03D11di34_Dependency; + _singletonM03D12di34_Dependency = new Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Dependency(); + _rootM03D12di._singletonM03D12di34_Dependency = _singletonM03D12di34_Dependency; } - _singletonM03D11di35_Service = new Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Service(_singletonM03D11di34_Dependency, _rootM03D11di._singletonM03D11di34_Dependency); - _rootM03D11di._singletonM03D11di35_Service = _singletonM03D11di35_Service; + _singletonM03D12di35_Service = new Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Service(_singletonM03D12di34_Dependency, _rootM03D12di._singletonM03D12di34_Dependency); + _rootM03D12di._singletonM03D12di35_Service = _singletonM03D12di35_Service; } } } - return _rootM03D11di._singletonM03D11di35_Service; + return _rootM03D12di._singletonM03D12di35_Service; } } #endregion @@ -169,7 +170,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -183,7 +184,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -196,10 +197,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -220,10 +221,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -267,26 +268,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -299,7 +300,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.IService Resolve(Composition composition) { diff --git a/readme/default-values.md b/readme/default-values.md index 822954e1d..c8b5f9b47 100644 --- a/readme/default-values.md +++ b/readme/default-values.md @@ -77,9 +77,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -98,14 +99,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -114,7 +115,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -144,7 +145,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -158,7 +159,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -171,10 +172,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -195,10 +196,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -242,26 +243,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DefaultValuesScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DefaultValuesScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -274,7 +275,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.DefaultValuesScenario.IService Resolve(Composition composition) { diff --git a/readme/dependent-compositions.md b/readme/dependent-compositions.md index 0a63d8765..5e791163a 100644 --- a/readme/dependent-compositions.md +++ b/readme/dependent-compositions.md @@ -99,9 +99,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -120,14 +121,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -136,7 +137,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -163,7 +164,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -177,7 +178,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -190,10 +191,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -214,10 +215,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -260,26 +261,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DependentCompositionsScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DependentCompositionsScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -292,7 +293,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.DependentCompositionsScenario.IService Resolve(Composition composition) { @@ -335,13 +336,15 @@ partial class Composition /// Program /// /// +/// Provides a composition root of type . /// /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -360,14 +363,14 @@ partial class Composition [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class OtherComposition { - private readonly OtherComposition _rootM03D11di; + private readonly OtherComposition _rootM03D12di; /// /// This constructor creates a new instance of . /// public OtherComposition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -376,7 +379,7 @@ partial class OtherComposition /// Base composition. internal OtherComposition(OtherComposition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -414,7 +417,7 @@ partial class OtherComposition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -428,7 +431,7 @@ partial class OtherComposition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -441,10 +444,10 @@ partial class OtherComposition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -465,10 +468,10 @@ partial class OtherComposition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -517,29 +520,29 @@ partial class OtherComposition " OtherComposition ..> Program : Program Program"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static OtherComposition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - var valResolverM03D11di_0001 = new ResolverM03D11di_0001(); - ResolverM03D11di.Value = valResolverM03D11di_0001; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + var valResolverM03D12di_0001 = new ResolverM03D12di_0001(); + ResolverM03D12di.Value = valResolverM03D12di_0001; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DependentCompositionsScenario.IService), valResolverM03D11di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DependentCompositionsScenario.Program), valResolverM03D11di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DependentCompositionsScenario.IService), valResolverM03D12di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DependentCompositionsScenario.Program), valResolverM03D12di_0001) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(OtherComposition composite) { @@ -552,7 +555,7 @@ partial class OtherComposition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.DependentCompositionsScenario.IService Resolve(OtherComposition composition) { @@ -570,7 +573,7 @@ partial class OtherComposition } } - private sealed class ResolverM03D11di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.DependentCompositionsScenario.Program Resolve(OtherComposition composition) { diff --git a/readme/disposable-singleton.md b/readme/disposable-singleton.md index 90bdb00dc..9193c456b 100644 --- a/readme/disposable-singleton.md +++ b/readme/disposable-singleton.md @@ -90,9 +90,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -111,20 +112,20 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition: global::System.IDisposable { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; - private readonly global::System.IDisposable[] _disposablesM03D11di; - private int _disposeIndexM03D11di; - private Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.Dependency _singletonM03D11di34_Dependency; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; + private readonly global::System.IDisposable[] _disposablesM03D12di; + private int _disposeIndexM03D12di; + private Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.Dependency _singletonM03D12di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); - _disposablesM03D11di = new global::System.IDisposable[1]; + _rootM03D12di = this; + _lockM03D12di = new object(); + _disposablesM03D12di = new global::System.IDisposable[1]; } /// @@ -133,8 +134,8 @@ partial class Composition: global::System.IDisposable /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots @@ -145,19 +146,19 @@ partial class Composition: global::System.IDisposable #endif get { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - _singletonM03D11di34_Dependency = new Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.Dependency(); - _rootM03D11di._singletonM03D11di34_Dependency = _singletonM03D11di34_Dependency; - _rootM03D11di._disposablesM03D11di[_rootM03D11di._disposeIndexM03D11di++] = _singletonM03D11di34_Dependency; + _singletonM03D12di34_Dependency = new Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.Dependency(); + _rootM03D12di._singletonM03D12di34_Dependency = _singletonM03D12di34_Dependency; + _rootM03D12di._disposablesM03D12di[_rootM03D12di._disposeIndexM03D12di++] = _singletonM03D12di34_Dependency; } } } - return new Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.Service(_rootM03D11di._singletonM03D11di34_Dependency); + return new Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.Service(_rootM03D12di._singletonM03D12di34_Dependency); } } #endregion @@ -173,7 +174,7 @@ partial class Composition: global::System.IDisposable #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -187,7 +188,7 @@ partial class Composition: global::System.IDisposable #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -200,10 +201,10 @@ partial class Composition: global::System.IDisposable #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -224,10 +225,10 @@ partial class Composition: global::System.IDisposable #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -244,11 +245,11 @@ partial class Composition: global::System.IDisposable /// public void Dispose() { - lock (_lockM03D11di) + lock (_lockM03D12di) { - while (_disposeIndexM03D11di > 0) + while (_disposeIndexM03D12di > 0) { - var disposableInstance = _disposablesM03D11di[--_disposeIndexM03D11di]; + var disposableInstance = _disposablesM03D12di[--_disposeIndexM03D12di]; try { disposableInstance.Dispose(); @@ -259,7 +260,7 @@ partial class Composition: global::System.IDisposable } } - _singletonM03D11di34_Dependency = null; + _singletonM03D12di34_Dependency = null; } } @@ -298,26 +299,26 @@ partial class Composition: global::System.IDisposable " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -330,7 +331,7 @@ partial class Composition: global::System.IDisposable } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.IService Resolve(Composition composition) { diff --git a/readme/enumerable-generics.md b/readme/enumerable-generics.md index f7c134be9..bb684d410 100644 --- a/readme/enumerable-generics.md +++ b/readme/enumerable-generics.md @@ -116,22 +116,24 @@ classDiagram /// /// /// -/// IntRoot +/// IntRoot /// /// +/// Provides a composition root of type . /// /// /// /// -/// StringRoot +/// StringRoot /// /// +/// Provides a composition root of type . /// /// /// /// /// -/// This shows how to get an instance of type using the composition root : +/// This shows how to get an instance of type using the composition root : /// /// var composition = new Composition(); /// var instance = composition.IntRoot; @@ -144,14 +146,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -160,7 +162,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -172,13 +174,13 @@ partial class Composition get { [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)0x200)] - System.Collections.Generic.IEnumerable> LocalperBlockM03D11di1_IEnumerable() + System.Collections.Generic.IEnumerable> LocalperBlockM03D12di1_IEnumerable() { yield return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.AbcDependency(); yield return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.XyzDependency(); } - var perBlockM03D11di1_IEnumerable = LocalperBlockM03D11di1_IEnumerable(); - return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.Service(perBlockM03D11di1_IEnumerable); + var perBlockM03D12di1_IEnumerable = LocalperBlockM03D12di1_IEnumerable(); + return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.Service(perBlockM03D12di1_IEnumerable); } } @@ -190,13 +192,13 @@ partial class Composition get { [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)0x200)] - System.Collections.Generic.IEnumerable> LocalperBlockM03D11di1_IEnumerable() + System.Collections.Generic.IEnumerable> LocalperBlockM03D12di1_IEnumerable() { yield return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.AbcDependency(); yield return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.XyzDependency(); } - var perBlockM03D11di1_IEnumerable = LocalperBlockM03D11di1_IEnumerable(); - return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.Service(perBlockM03D11di1_IEnumerable); + var perBlockM03D12di1_IEnumerable = LocalperBlockM03D12di1_IEnumerable(); + return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.Service(perBlockM03D12di1_IEnumerable); } } #endregion @@ -212,7 +214,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -226,7 +228,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -239,10 +241,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -263,10 +265,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -340,29 +342,29 @@ partial class Composition " ServiceᐸStringᐳ o-- \"PerBlock\" IEnumerableᐸIDependencyᐸStringᐳᐳ : IEnumerableᐸIDependencyᐸStringᐳᐳ"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di>.Value = valResolverM03D11di_0000; - var valResolverM03D11di_0001 = new ResolverM03D11di_0001(); - ResolverM03D11di>.Value = valResolverM03D11di_0001; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di>.Value = valResolverM03D12di_0000; + var valResolverM03D12di_0001 = new ResolverM03D12di_0001(); + ResolverM03D12di>.Value = valResolverM03D12di_0001; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.IService), valResolverM03D11di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.IService), valResolverM03D11di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.IService), valResolverM03D12di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.IService), valResolverM03D12di_0001) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -375,7 +377,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver> + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver> { public Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.IService Resolve(Composition composition) { @@ -393,7 +395,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0001: global::Pure.DI.IResolver> + private sealed class ResolverM03D12di_0001: global::Pure.DI.IResolver> { public Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.IService Resolve(Composition composition) { diff --git a/readme/enumerable.md b/readme/enumerable.md index fe52a7588..92d71f675 100644 --- a/readme/enumerable.md +++ b/readme/enumerable.md @@ -86,9 +86,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -107,14 +108,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -123,7 +124,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -135,13 +136,13 @@ partial class Composition get { [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)0x200)] - System.Collections.Generic.IEnumerable LocalperBlockM03D11di1_IEnumerable() + System.Collections.Generic.IEnumerable LocalperBlockM03D12di1_IEnumerable() { yield return new Pure.DI.UsageTests.BCL.EnumerableScenario.AbcDependency(); yield return new Pure.DI.UsageTests.BCL.EnumerableScenario.XyzDependency(); } - var perBlockM03D11di1_IEnumerable = LocalperBlockM03D11di1_IEnumerable(); - return new Pure.DI.UsageTests.BCL.EnumerableScenario.Service(perBlockM03D11di1_IEnumerable); + var perBlockM03D12di1_IEnumerable = LocalperBlockM03D12di1_IEnumerable(); + return new Pure.DI.UsageTests.BCL.EnumerableScenario.Service(perBlockM03D12di1_IEnumerable); } } #endregion @@ -157,7 +158,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -171,7 +172,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -184,10 +185,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -208,10 +209,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -261,26 +262,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.EnumerableScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.EnumerableScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -293,7 +294,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.EnumerableScenario.IService Resolve(Composition composition) { diff --git a/readme/factory.md b/readme/factory.md index f4ca27aab..106ee671c 100644 --- a/readme/factory.md +++ b/readme/factory.md @@ -88,9 +88,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -109,14 +110,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -125,7 +126,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -136,13 +137,13 @@ partial class Composition #endif get { - Pure.DI.UsageTests.Basics.FactoryScenario.Dependency transientM03D11di1_Dependency; + Pure.DI.UsageTests.Basics.FactoryScenario.Dependency transientM03D12di1_Dependency; { - var dependency_M03D11di1 = new Dependency(DateTimeOffset.Now); - dependency_M03D11di1.Initialize(); - transientM03D11di1_Dependency = dependency_M03D11di1; + var dependency_M03D12di1 = new Dependency(DateTimeOffset.Now); + dependency_M03D12di1.Initialize(); + transientM03D12di1_Dependency = dependency_M03D12di1; } - return new Pure.DI.UsageTests.Basics.FactoryScenario.Service(transientM03D11di1_Dependency); + return new Pure.DI.UsageTests.Basics.FactoryScenario.Service(transientM03D12di1_Dependency); } } #endregion @@ -158,7 +159,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -172,7 +173,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -185,10 +186,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -209,10 +210,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -253,26 +254,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.FactoryScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.FactoryScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -285,7 +286,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.FactoryScenario.IService Resolve(Composition composition) { diff --git a/readme/field-injection.md b/readme/field-injection.md index 2caecff26..54f5bc9ec 100644 --- a/readme/field-injection.md +++ b/readme/field-injection.md @@ -77,9 +77,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -98,14 +99,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -114,7 +115,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -125,9 +126,9 @@ partial class Composition #endif get { - var transientM03D11di0_Service = new Pure.DI.UsageTests.Basics.FieldInjectionScenario.Service(); - transientM03D11di0_Service.DependencyVal = new Pure.DI.UsageTests.Basics.FieldInjectionScenario.Dependency(); - return transientM03D11di0_Service; + var transientM03D12di0_Service = new Pure.DI.UsageTests.Basics.FieldInjectionScenario.Service(); + transientM03D12di0_Service.DependencyVal = new Pure.DI.UsageTests.Basics.FieldInjectionScenario.Dependency(); + return transientM03D12di0_Service; } } #endregion @@ -143,7 +144,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -157,7 +158,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -170,10 +171,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -194,10 +195,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -241,26 +242,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.FieldInjectionScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.FieldInjectionScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -273,7 +274,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.FieldInjectionScenario.IService Resolve(Composition composition) { diff --git a/readme/func-with-arguments.md b/readme/func-with-arguments.md index 2fa6dbf8f..09c38b29e 100644 --- a/readme/func-with-arguments.md +++ b/readme/func-with-arguments.md @@ -114,9 +114,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -135,17 +136,17 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; - private Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Clock _singletonM03D11di34_Clock; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; + private Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Clock _singletonM03D12di34_Clock; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -154,8 +155,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots @@ -166,24 +167,24 @@ partial class Composition #endif get { - System.Func transientM03D11di1_Func = dependencyId => + System.Func transientM03D12di1_Func = dependencyId => { - int transientM03D11di3_Int32 = dependencyId; - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Clock, null)) + int transientM03D12di3_Int32 = dependencyId; + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Clock, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Clock, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Clock, null)) { - _singletonM03D11di34_Clock = new Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Clock(); - _rootM03D11di._singletonM03D11di34_Clock = _singletonM03D11di34_Clock; + _singletonM03D12di34_Clock = new Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Clock(); + _rootM03D12di._singletonM03D12di34_Clock = _singletonM03D12di34_Clock; } } } - var dependency_M03D11di1 = new Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Dependency(_rootM03D11di._singletonM03D11di34_Clock, transientM03D11di3_Int32); - return dependency_M03D11di1; + var dependency_M03D12di1 = new Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Dependency(_rootM03D12di._singletonM03D12di34_Clock, transientM03D12di3_Int32); + return dependency_M03D12di1; }; - return new Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Service(transientM03D11di1_Func); + return new Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Service(transientM03D12di1_Func); } } #endregion @@ -199,7 +200,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -213,7 +214,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -226,10 +227,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -250,10 +251,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -304,26 +305,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -336,7 +337,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.IService Resolve(Composition composition) { diff --git a/readme/func.md b/readme/func.md index 3c31366b6..d5b9ecfe8 100644 --- a/readme/func.md +++ b/readme/func.md @@ -81,9 +81,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -102,16 +103,16 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -120,8 +121,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots @@ -132,15 +133,15 @@ partial class Composition #endif get { - var perResolveM03D11di36_Func = default(System.Func); - perResolveM03D11di36_Func = new global::System.Func( + var perResolveM03D12di36_Func = default(System.Func); + perResolveM03D12di36_Func = new global::System.Func( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - var factory_M03D11di1 = new Pure.DI.UsageTests.BCL.FuncScenario.Dependency(); - return factory_M03D11di1; + var factory_M03D12di1 = new Pure.DI.UsageTests.BCL.FuncScenario.Dependency(); + return factory_M03D12di1; }); - return new Pure.DI.UsageTests.BCL.FuncScenario.Service(perResolveM03D11di36_Func); + return new Pure.DI.UsageTests.BCL.FuncScenario.Service(perResolveM03D12di36_Func); } } #endregion @@ -156,7 +157,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -170,7 +171,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -183,10 +184,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -207,10 +208,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -255,26 +256,26 @@ partial class Composition " FuncᐸIDependencyᐳ *-- Dependency : IDependency"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.FuncScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.FuncScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -287,7 +288,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.FuncScenario.IService Resolve(Composition composition) { diff --git a/readme/generic-composition-roots.md b/readme/generic-composition-roots.md new file mode 100644 index 000000000..b0546347c --- /dev/null +++ b/readme/generic-composition-roots.md @@ -0,0 +1,303 @@ +#### Generic composition roots + +[![CSharp](https://img.shields.io/badge/C%23-code-blue.svg)](../tests/Pure.DI.UsageTests/Basics/GenericsCompositionRootsScenario.cs) + +A generic composition root is represented by a method. + +```c# +interface IDependency; + +class Dependency : IDependency; + +interface IService; + +class Service(IDependency dependency) : IService; + +class OtherService(IDependency dependency) : IService; + +DI.Setup(nameof(Composition)) + .Bind().To>() + .Bind().To>() + // Creates OtherService manually, + // just for the sake of example + .Bind("Other").To(ctx => + { + ctx.Inject(out IDependency dependency); + return new OtherService(dependency); + }) + + // Specifies to create a regular public method + // to get a composition root of type Service + // with the name "GetMyRoot" + .Root>("GetMyRoot") + + // Specifies to create a regular public method + // to get a composition root of type OtherService + // with the name "GetOtherService" + // using the "Other" tag + .Root>("GetOtherService", "Other"); + +var composition = new Composition(); + +// service = new Service(new Dependency()); +var service = composition.GetMyRoot(); + +// someOtherService = new OtherService(new Dependency()); +var someOtherService = composition.GetOtherService(); +``` + +When a generic composition root is used, `Resolve` methods cannot be used to resolve them. + +
+Class Diagram + +```mermaid +classDiagram + class Composition { + +IServiceᐸTᐳ GetMyRoot + +IServiceᐸTᐳ GetOtherService + + T ResolveᐸTᐳ() + + T ResolveᐸTᐳ(object? tag) + + object Resolve(Type type) + + object Resolve(Type type, object? tag) + } + ServiceᐸTᐳ --|> IServiceᐸTᐳ : + class ServiceᐸTᐳ { + +Service(IDependencyᐸTᐳ dependency) + } + OtherServiceᐸTᐳ --|> IServiceᐸTᐳ : "Other" + class OtherServiceᐸTᐳ + DependencyᐸTᐳ --|> IDependencyᐸTᐳ : + class DependencyᐸTᐳ { + +Dependency() + } + class IServiceᐸTᐳ { + <> + } + class IDependencyᐸTᐳ { + <> + } + Composition ..> ServiceᐸTᐳ : IServiceᐸTᐳ GetMyRoot + Composition ..> OtherServiceᐸTᐳ : "Other" IServiceᐸTᐳ GetOtherService + ServiceᐸTᐳ *-- DependencyᐸTᐳ : IDependencyᐸTᐳ + OtherServiceᐸTᐳ *-- DependencyᐸTᐳ : IDependencyᐸTᐳ +``` + +
+ +
+Pure.DI-generated partial class Composition
+ +```c# +/// +/// Composition roots:
+/// +/// +/// Root +/// Description +/// +/// +/// +/// GetMyRoot +/// +/// +/// Specifies to create a regular public method
+/// to get a composition root of type Service<T>
+/// with the name "GetMyRoot" +///
+///
+/// +/// +/// GetOtherService +/// +/// +/// Specifies to create a regular public method
+/// to get a composition root of type OtherService<T>
+/// with the name "GetOtherService"
+/// using the "Other" tag +///
+///
+///
+///
+/// +/// This shows how to get an instance of type using the composition root : +/// +/// var composition = new Composition(); +/// var instance = composition.GetMyRoot; +/// +/// +/// Class diagram
+/// This class was created by Pure.DI source code generator. +///
+/// +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +partial class Composition +{ + private readonly Composition _rootM03D12di; + + /// + /// This constructor creates a new instance of . + /// + public Composition() + { + _rootM03D12di = this; + } + + /// + /// This constructor creates a new instance of scope based on . This allows the life time to be applied. + /// + /// Base composition. + internal Composition(Composition baseComposition) + { + _rootM03D12di = baseComposition._rootM03D12di; + } + + #region Composition Roots + #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET + [global::System.Diagnostics.Contracts.Pure] + #endif + /// + /// Specifies to create a regular public method
+ /// to get a composition root of type Service<T>
+ /// with the name "GetMyRoot" + ///
+ public Pure.DI.UsageTests.Basics.GenericsCompositionRootsScenario.IService GetMyRoot() + { + return new Pure.DI.UsageTests.Basics.GenericsCompositionRootsScenario.Service(new Pure.DI.UsageTests.Basics.GenericsCompositionRootsScenario.Dependency()); + } + + #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET + [global::System.Diagnostics.Contracts.Pure] + #endif + /// + /// Specifies to create a regular public method
+ /// to get a composition root of type OtherService<T>
+ /// with the name "GetOtherService"
+ /// using the "Other" tag + ///
+ public Pure.DI.UsageTests.Basics.GenericsCompositionRootsScenario.IService GetOtherService() + { + Pure.DI.UsageTests.Basics.GenericsCompositionRootsScenario.OtherService transientM03D12di0_OtherService; + { + var dependency_M03D12di1 = new Pure.DI.UsageTests.Basics.GenericsCompositionRootsScenario.Dependency(); + transientM03D12di0_OtherService = new OtherService(dependency_M03D12di1); + } + return transientM03D12di0_OtherService; + } + #endregion + + #region API + /// + /// Resolves the composition root. + /// + /// The type of the composition root. + /// A composition root. + #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET + [global::System.Diagnostics.Contracts.Pure] + #endif + public T Resolve() + { + return ResolverM03D12di.Value.Resolve(this); + } + + /// + /// Resolves the composition root by tag. + /// + /// The type of the composition root. + /// The tag of a composition root. + /// A composition root. + #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET + [global::System.Diagnostics.Contracts.Pure] + #endif + public T Resolve(object? tag) + { + return ResolverM03D12di.Value.ResolveByTag(this, tag); + } + + /// + /// Resolves the composition root. + /// + /// The type of the composition root. + /// A composition root. + #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET + [global::System.Diagnostics.Contracts.Pure] + #endif + public object Resolve(global::System.Type type) + { + throw new global::System.InvalidOperationException($"Cannot resolve composition root of type {type}."); + } + + /// + /// Resolves the composition root by tag. + /// + /// The type of the composition root. + /// The tag of a composition root. + /// A composition root. + #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET + [global::System.Diagnostics.Contracts.Pure] + #endif + public object Resolve(global::System.Type type, object? tag) + { + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type {type}."); + } + #endregion + + /// + /// This method provides a class diagram in mermaid format. To see this diagram, simply call the method and copy the text to this site https://mermaid.live/. + /// + public override string ToString() + { + return + "classDiagram\n" + + " class Composition {\n" + + " +IServiceᐸTᐳ GetMyRoot\n" + + " +IServiceᐸTᐳ GetOtherService\n" + + " + T ResolveᐸTᐳ()\n" + + " + T ResolveᐸTᐳ(object? tag)\n" + + " + object Resolve(Type type)\n" + + " + object Resolve(Type type, object? tag)\n" + + " }\n" + + " ServiceᐸTᐳ --|> IServiceᐸTᐳ : \n" + + " class ServiceᐸTᐳ {\n" + + " +Service(IDependencyᐸTᐳ dependency)\n" + + " }\n" + + " OtherServiceᐸTᐳ --|> IServiceᐸTᐳ : \"Other\" \n" + + " class OtherServiceᐸTᐳ\n" + + " DependencyᐸTᐳ --|> IDependencyᐸTᐳ : \n" + + " class DependencyᐸTᐳ {\n" + + " +Dependency()\n" + + " }\n" + + " class IServiceᐸTᐳ {\n" + + " <>\n" + + " }\n" + + " class IDependencyᐸTᐳ {\n" + + " <>\n" + + " }\n" + + " Composition ..> ServiceᐸTᐳ : IServiceᐸTᐳ GetMyRoot\n" + + " Composition ..> OtherServiceᐸTᐳ : \"Other\" IServiceᐸTᐳ GetOtherService\n" + + " ServiceᐸTᐳ *-- DependencyᐸTᐳ : IDependencyᐸTᐳ\n" + + " OtherServiceᐸTᐳ *-- DependencyᐸTᐳ : IDependencyᐸTᐳ"; + } + + + #region Resolvers + private sealed class ResolverM03D12di: global::Pure.DI.IResolver + { + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); + + public T Resolve(Composition composite) + { + throw new global::System.InvalidOperationException($"Cannot resolve composition root of type {typeof(T)}."); + } + + public T ResolveByTag(Composition composite, object tag) + { + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type {typeof(T)}."); + } + } + #endregion +} +``` + + + diff --git a/readme/generics.md b/readme/generics.md index a476ff1d1..a82d2a6f8 100644 --- a/readme/generics.md +++ b/readme/generics.md @@ -100,9 +100,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -121,14 +122,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -137,7 +138,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -164,7 +165,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -178,7 +179,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -191,10 +192,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -215,10 +216,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -269,26 +270,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.GenericsScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.GenericsScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -301,7 +302,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.GenericsScenario.IService Resolve(Composition composition) { diff --git a/readme/injection.md b/readme/injection.md index e39432a59..58ece396a 100644 --- a/readme/injection.md +++ b/readme/injection.md @@ -78,9 +78,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -99,14 +100,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -115,7 +116,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -126,12 +127,12 @@ partial class Composition #endif get { - Pure.DI.UsageTests.Basics.InjectionScenario.Service transientM03D11di0_Service; + Pure.DI.UsageTests.Basics.InjectionScenario.Service transientM03D12di0_Service; { - var dependency_M03D11di1 = new Pure.DI.UsageTests.Basics.InjectionScenario.Dependency(); - transientM03D11di0_Service = new Service(dependency_M03D11di1); + var dependency_M03D12di1 = new Pure.DI.UsageTests.Basics.InjectionScenario.Dependency(); + transientM03D12di0_Service = new Service(dependency_M03D12di1); } - return transientM03D11di0_Service; + return transientM03D12di0_Service; } } #endregion @@ -147,7 +148,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -161,7 +162,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -174,10 +175,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -198,10 +199,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -242,26 +243,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.InjectionScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.InjectionScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -274,7 +275,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.InjectionScenario.IService Resolve(Composition composition) { diff --git a/readme/injections-of-abstractions.md b/readme/injections-of-abstractions.md index cc04d6595..cde28e76a 100644 --- a/readme/injections-of-abstractions.md +++ b/readme/injections-of-abstractions.md @@ -108,14 +108,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -124,7 +124,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots diff --git a/readme/instance-initialization.md b/readme/instance-initialization.md index c20d10fb2..cead8bbfe 100644 --- a/readme/instance-initialization.md +++ b/readme/instance-initialization.md @@ -94,9 +94,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -115,8 +116,8 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly string _argM03D11di_serviceName; + private readonly Composition _rootM03D12di; + private readonly string _argM03D12di_serviceName; /// /// This parameterized constructor creates a new instance of with arguments. @@ -124,13 +125,13 @@ partial class Composition /// The composition argument of type . public Composition(string serviceName) { - _rootM03D11di = this; + _rootM03D12di = this; if (ReferenceEquals(serviceName, null)) { throw new global::System.ArgumentNullException("serviceName"); } - _argM03D11di_serviceName = serviceName; + _argM03D12di_serviceName = serviceName; } /// @@ -139,8 +140,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _argM03D11di_serviceName = baseComposition._argM03D11di_serviceName; + _rootM03D12di = baseComposition._rootM03D12di; + _argM03D12di_serviceName = baseComposition._argM03D12di_serviceName; } #region Composition Roots @@ -151,13 +152,13 @@ partial class Composition #endif get { - Pure.DI.UsageTests.Basics.InstanceInitializationScenario.Service transientM03D11di0_Service; + Pure.DI.UsageTests.Basics.InstanceInitializationScenario.Service transientM03D12di0_Service; { - var service_M03D11di1 = new Pure.DI.UsageTests.Basics.InstanceInitializationScenario.Service(_argM03D11di_serviceName, new Pure.DI.UsageTests.Basics.InstanceInitializationScenario.Dependency()); - service_M03D11di1.Initialize(); - transientM03D11di0_Service = service_M03D11di1; + var service_M03D12di1 = new Pure.DI.UsageTests.Basics.InstanceInitializationScenario.Service(_argM03D12di_serviceName, new Pure.DI.UsageTests.Basics.InstanceInitializationScenario.Dependency()); + service_M03D12di1.Initialize(); + transientM03D12di0_Service = service_M03D12di1; } - return transientM03D11di0_Service; + return transientM03D12di0_Service; } } #endregion @@ -173,7 +174,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -187,7 +188,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -200,10 +201,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -224,10 +225,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -268,26 +269,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.InstanceInitializationScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.InstanceInitializationScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -300,7 +301,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.InstanceInitializationScenario.IService Resolve(Composition composition) { diff --git a/readme/interception.md b/readme/interception.md index cd8d380b0..b87d4a886 100644 --- a/readme/interception.md +++ b/readme/interception.md @@ -90,9 +90,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -111,14 +112,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -127,7 +128,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -154,7 +155,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -168,7 +169,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -181,10 +182,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -205,10 +206,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -245,26 +246,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Interception.InterceptionScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Interception.InterceptionScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -277,7 +278,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Interception.InterceptionScenario.IService Resolve(Composition composition) { diff --git a/readme/keyed-service-provider.md b/readme/keyed-service-provider.md index 534d635bd..f267a2151 100644 --- a/readme/keyed-service-provider.md +++ b/readme/keyed-service-provider.md @@ -50,8 +50,8 @@ service.Dependency.ShouldBe(dependency); ```mermaid classDiagram class Composition { - -IDependency RootM03D11di0001 - -IService RootM03D11di0002 + -IDependency RootM03D12di0001 + -IService RootM03D12di0002 + T ResolveᐸTᐳ() + T ResolveᐸTᐳ(object? tag) + object GetService(Type type) @@ -72,8 +72,8 @@ classDiagram <> } Service o-- "Singleton" Dependency : "Dependency Key" IDependency - Composition ..> Dependency : "Dependency Key" IDependency RootM03D11di0001 - Composition ..> Service : "Service Key" IService RootM03D11di0002 + Composition ..> Dependency : "Dependency Key" IDependency RootM03D12di0001 + Composition ..> Service : "Service Key" IService RootM03D12di0002 ``` @@ -91,38 +91,40 @@ classDiagram /// /// /// -/// is a private composition root that can be resolved by methods like . +/// is a private composition root that can be resolved by methods like . /// /// +/// Provides a composition root of type . /// /// /// /// -/// is a private composition root that can be resolved by methods like . +/// is a private composition root that can be resolved by methods like . /// /// +/// Provides a composition root of type . /// /// /// /// -/// Class diagram
+/// Class diagram
/// This class was created by Pure.DI source code generator. ///
/// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; - private Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Dependency _singletonM03D11di34_Dependency; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; + private Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Dependency _singletonM03D12di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -131,52 +133,52 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots - public Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IDependency RootM03D11di0001 + public Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IDependency RootM03D12di0001 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - _singletonM03D11di34_Dependency = new Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Dependency(); - _rootM03D11di._singletonM03D11di34_Dependency = _singletonM03D11di34_Dependency; + _singletonM03D12di34_Dependency = new Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Dependency(); + _rootM03D12di._singletonM03D12di34_Dependency = _singletonM03D12di34_Dependency; } } } - return _rootM03D11di._singletonM03D11di34_Dependency; + return _rootM03D12di._singletonM03D12di34_Dependency; } } - public Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IService RootM03D11di0002 + public Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IService RootM03D12di0002 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - _singletonM03D11di34_Dependency = new Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Dependency(); - _rootM03D11di._singletonM03D11di34_Dependency = _singletonM03D11di34_Dependency; + _singletonM03D12di34_Dependency = new Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Dependency(); + _rootM03D12di._singletonM03D12di34_Dependency = _singletonM03D12di34_Dependency; } } } - return new Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Service(_rootM03D11di._singletonM03D11di34_Dependency); + return new Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Service(_rootM03D12di._singletonM03D12di34_Dependency); } } #endregion @@ -192,7 +194,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -206,7 +208,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -219,10 +221,10 @@ partial class Composition #endif public object GetService(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -243,10 +245,10 @@ partial class Composition #endif public object GetRequiredKeyedService(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -265,8 +267,8 @@ partial class Composition return "classDiagram\n" + " class Composition {\n" + - " -IDependency RootM03D11di0001\n" + - " -IService RootM03D11di0002\n" + + " -IDependency RootM03D12di0001\n" + + " -IService RootM03D12di0002\n" + " + T ResolveᐸTᐳ()\n" + " + T ResolveᐸTᐳ(object? tag)\n" + " + object GetService(Type type)\n" + @@ -287,33 +289,33 @@ partial class Composition " <>\n" + " }\n" + " Service o-- \"Singleton\" Dependency : \"Dependency Key\" IDependency\n" + - " Composition ..> Dependency : \"Dependency Key\" IDependency RootM03D11di0001\n" + - " Composition ..> Service : \"Service Key\" IService RootM03D11di0002"; + " Composition ..> Dependency : \"Dependency Key\" IDependency RootM03D12di0001\n" + + " Composition ..> Service : \"Service Key\" IService RootM03D12di0002"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - var valResolverM03D11di_0001 = new ResolverM03D11di_0001(); - ResolverM03D11di.Value = valResolverM03D11di_0001; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + var valResolverM03D12di_0001 = new ResolverM03D12di_0001(); + ResolverM03D12di.Value = valResolverM03D12di_0001; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IDependency), valResolverM03D11di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IService), valResolverM03D11di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IDependency), valResolverM03D12di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IService), valResolverM03D12di_0001) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -326,7 +328,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IDependency Resolve(Composition composition) { @@ -338,13 +340,13 @@ partial class Composition switch (tag) { case "Dependency Key": - return composition.RootM03D11di0001; + return composition.RootM03D12di0001; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IDependency."); } } - private sealed class ResolverM03D11di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IService Resolve(Composition composition) { @@ -356,7 +358,7 @@ partial class Composition switch (tag) { case "Service Key": - return composition.RootM03D11di0002; + return composition.RootM03D12di0002; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IService."); } diff --git a/readme/lazy.md b/readme/lazy.md index 8ffe5eb05..e1d8c0bee 100644 --- a/readme/lazy.md +++ b/readme/lazy.md @@ -75,9 +75,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -96,16 +97,16 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -114,8 +115,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots @@ -126,20 +127,20 @@ partial class Composition #endif get { - var perResolveM03D11di37_Func = default(System.Func); - perResolveM03D11di37_Func = new global::System.Func( + var perResolveM03D12di37_Func = default(System.Func); + perResolveM03D12di37_Func = new global::System.Func( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - var factory_M03D11di1 = new Pure.DI.UsageTests.BCL.LazyScenario.Dependency(); - return factory_M03D11di1; + var factory_M03D12di1 = new Pure.DI.UsageTests.BCL.LazyScenario.Dependency(); + return factory_M03D12di1; }); - System.Lazy transientM03D11di1_Lazy; + System.Lazy transientM03D12di1_Lazy; { - var factory_M03D11di2 = perResolveM03D11di37_Func; - transientM03D11di1_Lazy = new global::System.Lazy(factory_M03D11di2, true); + var factory_M03D12di2 = perResolveM03D12di37_Func; + transientM03D12di1_Lazy = new global::System.Lazy(factory_M03D12di2, true); } - return new Pure.DI.UsageTests.BCL.LazyScenario.Service(transientM03D11di1_Lazy); + return new Pure.DI.UsageTests.BCL.LazyScenario.Service(transientM03D12di1_Lazy); } } #endregion @@ -155,7 +156,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -169,7 +170,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -182,10 +183,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -206,10 +207,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -256,26 +257,26 @@ partial class Composition " FuncᐸIDependencyᐳ *-- Dependency : IDependency"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.LazyScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.LazyScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -288,7 +289,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.LazyScenario.IService Resolve(Composition composition) { diff --git a/readme/manually-started-tasks.md b/readme/manually-started-tasks.md index e769e0fee..a5a0b29fb 100644 --- a/readme/manually-started-tasks.md +++ b/readme/manually-started-tasks.md @@ -116,9 +116,10 @@ classDiagram /// /// /// -/// GetRoot +/// GetRoot /// /// +/// Provides a composition root of type . /// /// /// @@ -137,16 +138,16 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; /// /// This parameterized constructor creates a new instance of with arguments. /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -155,8 +156,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots @@ -165,21 +166,21 @@ partial class Composition #endif public Pure.DI.UsageTests.BCL.ManualTaskScenario.IService GetRoot(System.Threading.CancellationToken cancellationToken) { - var perResolveM03D11di39_Func = default(System.Func); - perResolveM03D11di39_Func = new global::System.Func( + var perResolveM03D12di39_Func = default(System.Func); + perResolveM03D12di39_Func = new global::System.Func( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - var factory_M03D11di1 = new Pure.DI.UsageTests.BCL.ManualTaskScenario.Dependency(); - return factory_M03D11di1; + var factory_M03D12di1 = new Pure.DI.UsageTests.BCL.ManualTaskScenario.Dependency(); + return factory_M03D12di1; }); - System.Threading.Tasks.Task transientM03D11di1_Task; + System.Threading.Tasks.Task transientM03D12di1_Task; { - var factory_M03D11di2 = perResolveM03D11di39_Func; - var cancellationToken_M03D11di3 = cancellationToken; - transientM03D11di1_Task = new Task(factory_M03D11di2, cancellationToken_M03D11di3); + var factory_M03D12di2 = perResolveM03D12di39_Func; + var cancellationToken_M03D12di3 = cancellationToken; + transientM03D12di1_Task = new Task(factory_M03D12di2, cancellationToken_M03D12di3); } - return new Pure.DI.UsageTests.BCL.ManualTaskScenario.Service(transientM03D11di1_Task); + return new Pure.DI.UsageTests.BCL.ManualTaskScenario.Service(transientM03D12di1_Task); } #endregion diff --git a/readme/member-ordinal-attribute.md b/readme/member-ordinal-attribute.md index 259d6bad0..eb740e7b3 100644 --- a/readme/member-ordinal-attribute.md +++ b/readme/member-ordinal-attribute.md @@ -104,9 +104,10 @@ classDiagram /// /// /// -/// Person +/// Person /// /// +/// Provides a composition root of type . /// /// /// @@ -125,10 +126,10 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class PersonComposition { - private readonly PersonComposition _rootM03D11di; - private readonly int _argM03D11di_personId; - private readonly string _argM03D11di_personName; - private readonly System.DateTime _argM03D11di_personBirthday; + private readonly PersonComposition _rootM03D12di; + private readonly int _argM03D12di_personId; + private readonly string _argM03D12di_personName; + private readonly System.DateTime _argM03D12di_personBirthday; /// /// This parameterized constructor creates a new instance of with arguments. @@ -138,15 +139,15 @@ partial class PersonComposition /// The composition argument of type . public PersonComposition(int personId, string personName, System.DateTime personBirthday) { - _rootM03D11di = this; + _rootM03D12di = this; if (ReferenceEquals(personName, null)) { throw new global::System.ArgumentNullException("personName"); } - _argM03D11di_personId = personId; - _argM03D11di_personName = personName; - _argM03D11di_personBirthday = personBirthday; + _argM03D12di_personId = personId; + _argM03D12di_personName = personName; + _argM03D12di_personBirthday = personBirthday; } /// @@ -155,10 +156,10 @@ partial class PersonComposition /// Base composition. internal PersonComposition(PersonComposition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _argM03D11di_personId = baseComposition._argM03D11di_personId; - _argM03D11di_personName = baseComposition._argM03D11di_personName; - _argM03D11di_personBirthday = baseComposition._argM03D11di_personBirthday; + _rootM03D12di = baseComposition._rootM03D12di; + _argM03D12di_personId = baseComposition._argM03D12di_personId; + _argM03D12di_personName = baseComposition._argM03D12di_personName; + _argM03D12di_personBirthday = baseComposition._argM03D12di_personBirthday; } #region Composition Roots @@ -169,11 +170,11 @@ partial class PersonComposition #endif get { - var transientM03D11di0_Person = new Pure.DI.UsageTests.Attributes.MemberOrdinalAttributeScenario.Person(); - transientM03D11di0_Person.Id = _argM03D11di_personId; - transientM03D11di0_Person.FirstName = _argM03D11di_personName; - transientM03D11di0_Person.Birthday = _argM03D11di_personBirthday; - return transientM03D11di0_Person; + var transientM03D12di0_Person = new Pure.DI.UsageTests.Attributes.MemberOrdinalAttributeScenario.Person(); + transientM03D12di0_Person.Id = _argM03D12di_personId; + transientM03D12di0_Person.FirstName = _argM03D12di_personName; + transientM03D12di0_Person.Birthday = _argM03D12di_personBirthday; + return transientM03D12di0_Person; } } #endregion @@ -189,7 +190,7 @@ partial class PersonComposition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -203,7 +204,7 @@ partial class PersonComposition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -216,10 +217,10 @@ partial class PersonComposition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -240,10 +241,10 @@ partial class PersonComposition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -287,26 +288,26 @@ partial class PersonComposition " PersonComposition ..> Person : IPerson Person"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static PersonComposition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.MemberOrdinalAttributeScenario.IPerson), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.MemberOrdinalAttributeScenario.IPerson), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(PersonComposition composite) { @@ -319,7 +320,7 @@ partial class PersonComposition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Attributes.MemberOrdinalAttributeScenario.IPerson Resolve(PersonComposition composition) { diff --git a/readme/method-injection.md b/readme/method-injection.md index 557729fc0..eb2953689 100644 --- a/readme/method-injection.md +++ b/readme/method-injection.md @@ -78,9 +78,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -99,14 +100,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -115,7 +116,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -126,9 +127,9 @@ partial class Composition #endif get { - var transientM03D11di0_Service = new Pure.DI.UsageTests.Basics.MethodInjectionScenario.Service(); - transientM03D11di0_Service.SetDependency(new Pure.DI.UsageTests.Basics.MethodInjectionScenario.Dependency()); - return transientM03D11di0_Service; + var transientM03D12di0_Service = new Pure.DI.UsageTests.Basics.MethodInjectionScenario.Service(); + transientM03D12di0_Service.SetDependency(new Pure.DI.UsageTests.Basics.MethodInjectionScenario.Dependency()); + return transientM03D12di0_Service; } } #endregion @@ -144,7 +145,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -158,7 +159,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -171,10 +172,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -195,10 +196,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -242,26 +243,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.MethodInjectionScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.MethodInjectionScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -274,7 +275,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.MethodInjectionScenario.IService Resolve(Composition composition) { diff --git a/readme/multi-contract-bindings.md b/readme/multi-contract-bindings.md index 572c6ccc9..a9f2a6316 100644 --- a/readme/multi-contract-bindings.md +++ b/readme/multi-contract-bindings.md @@ -78,9 +78,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -99,14 +100,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -115,7 +116,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -142,7 +143,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -156,7 +157,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -169,10 +170,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -193,10 +194,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -244,26 +245,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.MultiContractBindingsScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.MultiContractBindingsScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -276,7 +277,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.MultiContractBindingsScenario.IService Resolve(Composition composition) { diff --git a/readme/oncannotresolve-hint.md b/readme/oncannotresolve-hint.md index f357c83bb..17172455c 100644 --- a/readme/oncannotresolve-hint.md +++ b/readme/oncannotresolve-hint.md @@ -103,9 +103,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -124,14 +125,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -140,7 +141,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -151,8 +152,8 @@ partial class Composition #endif get { - var transientM03D11di2_String = OnCannotResolve(null, Pure.DI.Lifetime.Transient); - return new Pure.DI.UsageTests.Hints.OnCannotResolveHintScenario.Service(new Pure.DI.UsageTests.Hints.OnCannotResolveHintScenario.Dependency(transientM03D11di2_String)); + var transientM03D12di2_String = OnCannotResolve(null, Pure.DI.Lifetime.Transient); + return new Pure.DI.UsageTests.Hints.OnCannotResolveHintScenario.Service(new Pure.DI.UsageTests.Hints.OnCannotResolveHintScenario.Dependency(transientM03D12di2_String)); } } #endregion @@ -168,7 +169,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -182,7 +183,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -195,10 +196,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -219,10 +220,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -269,26 +270,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.OnCannotResolveHintScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.OnCannotResolveHintScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -301,7 +302,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Hints.OnCannotResolveHintScenario.IService Resolve(Composition composition) { diff --git a/readme/ondependencyinjection-hint.md b/readme/ondependencyinjection-hint.md index 7ed8860b3..c0d370e76 100644 --- a/readme/ondependencyinjection-hint.md +++ b/readme/ondependencyinjection-hint.md @@ -100,9 +100,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -121,14 +122,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -137,7 +138,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -164,7 +165,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -178,7 +179,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -191,10 +192,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -215,10 +216,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -263,26 +264,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.OnDependencyInjectionHintScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.OnDependencyInjectionHintScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -295,7 +296,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Hints.OnDependencyInjectionHintScenario.IService Resolve(Composition composition) { diff --git a/readme/onnewinstance-hint.md b/readme/onnewinstance-hint.md index 0c5511026..5cdbccc05 100644 --- a/readme/onnewinstance-hint.md +++ b/readme/onnewinstance-hint.md @@ -102,9 +102,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -123,17 +124,17 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; - private Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Dependency _singletonM03D11di34_Dependency; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; + private Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Dependency _singletonM03D12di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -142,8 +143,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots @@ -154,24 +155,24 @@ partial class Composition #endif get { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Dependency _singletonM03D11di34_DependencyTemp; - _singletonM03D11di34_DependencyTemp = new Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Dependency(); - OnNewInstance(ref _singletonM03D11di34_DependencyTemp, null, Pure.DI.Lifetime.Singleton); + Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Dependency _singletonM03D12di34_DependencyTemp; + _singletonM03D12di34_DependencyTemp = new Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Dependency(); + OnNewInstance(ref _singletonM03D12di34_DependencyTemp, null, Pure.DI.Lifetime.Singleton); global::System.Threading.Thread.MemoryBarrier(); - _singletonM03D11di34_Dependency = _singletonM03D11di34_DependencyTemp; - _rootM03D11di._singletonM03D11di34_Dependency = _singletonM03D11di34_Dependency; + _singletonM03D12di34_Dependency = _singletonM03D12di34_DependencyTemp; + _rootM03D12di._singletonM03D12di34_Dependency = _singletonM03D12di34_Dependency; } } } - var transientM03D11di0_Service = new Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Service(_rootM03D11di._singletonM03D11di34_Dependency); - OnNewInstance(ref transientM03D11di0_Service, null, Pure.DI.Lifetime.Transient); - return transientM03D11di0_Service; + var transientM03D12di0_Service = new Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Service(_rootM03D12di._singletonM03D12di34_Dependency); + OnNewInstance(ref transientM03D12di0_Service, null, Pure.DI.Lifetime.Transient); + return transientM03D12di0_Service; } } #endregion @@ -187,7 +188,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -201,7 +202,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -214,10 +215,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -238,10 +239,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -286,26 +287,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -318,7 +319,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.IService Resolve(Composition composition) { diff --git a/readme/overriding-the-bcl-binding.md b/readme/overriding-the-bcl-binding.md index 3ea29b841..c78680338 100644 --- a/readme/overriding-the-bcl-binding.md +++ b/readme/overriding-the-bcl-binding.md @@ -77,9 +77,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -98,14 +99,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -114,7 +115,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -125,13 +126,13 @@ partial class Composition #endif get { - Pure.DI.UsageTests.BCL.OverridingBclBindingScenario.IDependency[] transientM03D11di1_ = new IDependency[] + Pure.DI.UsageTests.BCL.OverridingBclBindingScenario.IDependency[] transientM03D12di1_ = new IDependency[] { new AbcDependency(), new XyzDependency(), new AbcDependency() }; - return new Pure.DI.UsageTests.BCL.OverridingBclBindingScenario.Service(transientM03D11di1_); + return new Pure.DI.UsageTests.BCL.OverridingBclBindingScenario.Service(transientM03D12di1_); } } #endregion @@ -147,7 +148,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -161,7 +162,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -174,10 +175,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -198,10 +199,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -238,26 +239,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.OverridingBclBindingScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.OverridingBclBindingScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -270,7 +271,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.OverridingBclBindingScenario.IService Resolve(Composition composition) { diff --git a/readme/partial-class.md b/readme/partial-class.md index f82fa314e..cd5633864 100644 --- a/readme/partial-class.md +++ b/readme/partial-class.md @@ -114,6 +114,7 @@ classDiagram /// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -132,14 +133,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -148,7 +149,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -159,10 +160,10 @@ partial class Composition #endif get { - long transientM03D11di5_Int64 = GenerateId(); - long transientM03D11di4_Int64 = GenerateId(); - string transientM03D11di1_String = $"{_serviceName}_{GenerateId()}"; - return new Pure.DI.UsageTests.Basics.PartialClassScenario.Service(transientM03D11di1_String, new Pure.DI.UsageTests.Basics.PartialClassScenario.Dependency(transientM03D11di5_Int64), new Pure.DI.UsageTests.Basics.PartialClassScenario.Dependency(transientM03D11di4_Int64)); + long transientM03D12di5_Int64 = GenerateId(); + long transientM03D12di4_Int64 = GenerateId(); + string transientM03D12di1_String = $"{_serviceName}_{GenerateId()}"; + return new Pure.DI.UsageTests.Basics.PartialClassScenario.Service(transientM03D12di1_String, new Pure.DI.UsageTests.Basics.PartialClassScenario.Dependency(transientM03D12di5_Int64), new Pure.DI.UsageTests.Basics.PartialClassScenario.Dependency(transientM03D12di4_Int64)); } } #endregion @@ -178,7 +179,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -192,7 +193,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -205,10 +206,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -229,10 +230,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -276,26 +277,26 @@ partial class Composition " Composition ..> Service : Service Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.PartialClassScenario.Service), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.PartialClassScenario.Service), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -308,7 +309,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.PartialClassScenario.Service Resolve(Composition composition) { diff --git a/readme/perblock.md b/readme/perblock.md index ee99f4edb..5594d8a0c 100644 --- a/readme/perblock.md +++ b/readme/perblock.md @@ -93,6 +93,7 @@ classDiagram /// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -111,16 +112,16 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -129,8 +130,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots @@ -141,22 +142,22 @@ partial class Composition #endif get { - var perResolveM03D11di40_Func = default(System.Func<(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep4)>); - perResolveM03D11di40_Func = new global::System.Func<(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep4)>( + var perResolveM03D12di40_Func = default(System.Func<(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep4)>); + perResolveM03D12di40_Func = new global::System.Func<(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep4)>( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - var perBlockM03D11di4_Dependency = new Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Dependency(); - var factory_M03D11di1 = (perBlockM03D11di4_Dependency, perBlockM03D11di4_Dependency); - return factory_M03D11di1; + var perBlockM03D12di4_Dependency = new Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Dependency(); + var factory_M03D12di1 = (perBlockM03D12di4_Dependency, perBlockM03D12di4_Dependency); + return factory_M03D12di1; }); - System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep4)> transientM03D11di2_Lazy; + System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep4)> transientM03D12di2_Lazy; { - var factory_M03D11di2 = perResolveM03D11di40_Func; - transientM03D11di2_Lazy = new global::System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep4)>(factory_M03D11di2, true); + var factory_M03D12di2 = perResolveM03D12di40_Func; + transientM03D12di2_Lazy = new global::System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep4)>(factory_M03D12di2, true); } - var perBlockM03D11di1_Dependency = new Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Dependency(); - return new Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Service(perBlockM03D11di1_Dependency, perBlockM03D11di1_Dependency, transientM03D11di2_Lazy); + var perBlockM03D12di1_Dependency = new Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Dependency(); + return new Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Service(perBlockM03D12di1_Dependency, perBlockM03D12di1_Dependency, transientM03D12di2_Lazy); } } #endregion @@ -172,7 +173,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -186,7 +187,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -199,10 +200,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -223,10 +224,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -276,26 +277,26 @@ partial class Composition " FuncᐸValueTupleᐸIDependencyˏIDependencyᐳᐳ *-- ValueTupleᐸIDependencyˏIDependencyᐳ : ValueTupleᐸIDependencyˏIDependencyᐳ"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Service), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Service), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -308,7 +309,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Service Resolve(Composition composition) { diff --git a/readme/perresolve.md b/readme/perresolve.md index 146fbf873..db81eb7b1 100644 --- a/readme/perresolve.md +++ b/readme/perresolve.md @@ -93,6 +93,7 @@ classDiagram /// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -111,16 +112,16 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -129,8 +130,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots @@ -141,41 +142,41 @@ partial class Composition #endif get { - var perResolveM03D11di34_Dependency = default(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Dependency); - var perResolveM03D11di40_Func = default(System.Func<(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep4)>); - perResolveM03D11di40_Func = new global::System.Func<(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep4)>( + var perResolveM03D12di34_Dependency = default(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Dependency); + var perResolveM03D12di40_Func = default(System.Func<(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep4)>); + perResolveM03D12di40_Func = new global::System.Func<(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep4)>( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - if (ReferenceEquals(perResolveM03D11di34_Dependency, null)) + if (ReferenceEquals(perResolveM03D12di34_Dependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(perResolveM03D11di34_Dependency, null)) + if (ReferenceEquals(perResolveM03D12di34_Dependency, null)) { - perResolveM03D11di34_Dependency = new Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Dependency(); + perResolveM03D12di34_Dependency = new Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Dependency(); } } } - var factory_M03D11di1 = (perResolveM03D11di34_Dependency, perResolveM03D11di34_Dependency); - return factory_M03D11di1; + var factory_M03D12di1 = (perResolveM03D12di34_Dependency, perResolveM03D12di34_Dependency); + return factory_M03D12di1; }); - System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep4)> transientM03D11di1_Lazy; + System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep4)> transientM03D12di1_Lazy; { - var factory_M03D11di2 = perResolveM03D11di40_Func; - transientM03D11di1_Lazy = new global::System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep4)>(factory_M03D11di2, true); + var factory_M03D12di2 = perResolveM03D12di40_Func; + transientM03D12di1_Lazy = new global::System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep4)>(factory_M03D12di2, true); } - if (ReferenceEquals(perResolveM03D11di34_Dependency, null)) + if (ReferenceEquals(perResolveM03D12di34_Dependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(perResolveM03D11di34_Dependency, null)) + if (ReferenceEquals(perResolveM03D12di34_Dependency, null)) { - perResolveM03D11di34_Dependency = new Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Dependency(); + perResolveM03D12di34_Dependency = new Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Dependency(); } } } - return new Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Service(perResolveM03D11di34_Dependency, perResolveM03D11di34_Dependency, transientM03D11di1_Lazy); + return new Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Service(perResolveM03D12di34_Dependency, perResolveM03D12di34_Dependency, transientM03D12di1_Lazy); } } #endregion @@ -191,7 +192,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -205,7 +206,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -218,10 +219,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -242,10 +243,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -295,26 +296,26 @@ partial class Composition " FuncᐸValueTupleᐸIDependencyˏIDependencyᐳᐳ *-- ValueTupleᐸIDependencyˏIDependencyᐳ : ValueTupleᐸIDependencyˏIDependencyᐳ"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Service), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Service), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -327,7 +328,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Service Resolve(Composition composition) { diff --git a/readme/property-injection.md b/readme/property-injection.md index 630ad143b..f423223e9 100644 --- a/readme/property-injection.md +++ b/readme/property-injection.md @@ -75,9 +75,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -96,14 +97,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -112,7 +113,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -123,9 +124,9 @@ partial class Composition #endif get { - var transientM03D11di0_Service = new Pure.DI.UsageTests.Basics.PropertyInjectionScenario.Service(); - transientM03D11di0_Service.Dependency = new Pure.DI.UsageTests.Basics.PropertyInjectionScenario.Dependency(); - return transientM03D11di0_Service; + var transientM03D12di0_Service = new Pure.DI.UsageTests.Basics.PropertyInjectionScenario.Service(); + transientM03D12di0_Service.Dependency = new Pure.DI.UsageTests.Basics.PropertyInjectionScenario.Dependency(); + return transientM03D12di0_Service; } } #endregion @@ -141,7 +142,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -155,7 +156,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -168,10 +169,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -192,10 +193,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -239,26 +240,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.PropertyInjectionScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.PropertyInjectionScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -271,7 +272,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.PropertyInjectionScenario.IService Resolve(Composition composition) { diff --git a/readme/required-properties-or-fields.md b/readme/required-properties-or-fields.md index c2a82da53..4917d7cad 100644 --- a/readme/required-properties-or-fields.md +++ b/readme/required-properties-or-fields.md @@ -85,9 +85,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -106,8 +107,8 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly string _argM03D11di_name; + private readonly Composition _rootM03D12di; + private readonly string _argM03D12di_name; /// /// This parameterized constructor creates a new instance of with arguments. @@ -115,13 +116,13 @@ partial class Composition /// The composition argument of type . public Composition(string name) { - _rootM03D11di = this; + _rootM03D12di = this; if (ReferenceEquals(name, null)) { throw new global::System.ArgumentNullException("name"); } - _argM03D11di_name = name; + _argM03D12di_name = name; } /// @@ -130,8 +131,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _argM03D11di_name = baseComposition._argM03D11di_name; + _rootM03D12di = baseComposition._rootM03D12di; + _argM03D12di_name = baseComposition._argM03D12di_name; } #region Composition Roots @@ -144,7 +145,7 @@ partial class Composition { return new Pure.DI.UsageTests.Basics.RequiredPropertiesOrFieldsScenario.Service() { - ServiceNameField = _argM03D11di_name, + ServiceNameField = _argM03D12di_name, Dependency = new Pure.DI.UsageTests.Basics.RequiredPropertiesOrFieldsScenario.Dependency() }; } @@ -162,7 +163,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -176,7 +177,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -189,10 +190,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -213,10 +214,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -263,26 +264,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.RequiredPropertiesOrFieldsScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.RequiredPropertiesOrFieldsScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -295,7 +296,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.RequiredPropertiesOrFieldsScenario.IService Resolve(Composition composition) { diff --git a/readme/resolve-hint.md b/readme/resolve-hint.md index 5a5a9e311..8458d6232 100644 --- a/readme/resolve-hint.md +++ b/readme/resolve-hint.md @@ -71,16 +71,18 @@ classDiagram /// /// /// -/// DependencyRoot +/// DependencyRoot /// /// +/// Provides a composition root of type . /// /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -99,14 +101,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -115,7 +117,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots diff --git a/readme/resolve-methods.md b/readme/resolve-methods.md index 9199bb5a8..a6dbf0731 100644 --- a/readme/resolve-methods.md +++ b/readme/resolve-methods.md @@ -47,7 +47,7 @@ classDiagram class Composition { +IDependency DependencySingleton +IService OtherService - -IService RootM03D11di0002 + -IService RootM03D12di0002 + T ResolveᐸTᐳ() + T ResolveᐸTᐳ(object? tag) + object Resolve(Type type) @@ -73,7 +73,7 @@ classDiagram } Service *-- Dependency : IDependency Composition ..> Dependency : IDependency DependencySingleton - Composition ..> Service : IService RootM03D11di0002 + Composition ..> Service : IService RootM03D12di0002 Composition ..> OtherService : "Other" IService OtherService ``` @@ -92,7 +92,7 @@ classDiagram /// /// /// -/// DependencySingleton +/// DependencySingleton /// /// /// Specifies to create a regular public composition root
@@ -101,7 +101,7 @@ classDiagram ///
/// /// -/// OtherService +/// OtherService /// /// /// Specifies to create a public root named _OtherService_
@@ -110,7 +110,7 @@ classDiagram ///
/// /// -/// is a private composition root that can be resolved by methods like . +/// is a private composition root that can be resolved by methods like . /// /// /// Specifies to create a private root
@@ -126,21 +126,21 @@ classDiagram /// var instance = composition.DependencySingleton; /// /// -/// Class diagram
+/// Class diagram
/// This class was created by Pure.DI source code generator. ///
/// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -149,7 +149,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -187,7 +187,7 @@ partial class Composition /// Specifies to create a private root
/// that is only accessible from _Resolve_ methods ///
- public Pure.DI.UsageTests.Basics.ResolveScenario.IService RootM03D11di0002 + public Pure.DI.UsageTests.Basics.ResolveScenario.IService RootM03D12di0002 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] @@ -210,7 +210,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -224,7 +224,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -237,10 +237,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -261,10 +261,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -285,7 +285,7 @@ partial class Composition " class Composition {\n" + " +IDependency DependencySingleton\n" + " +IService OtherService\n" + - " -IService RootM03D11di0002\n" + + " -IService RootM03D12di0002\n" + " + T ResolveᐸTᐳ()\n" + " + T ResolveᐸTᐳ(object? tag)\n" + " + object Resolve(Type type)\n" + @@ -311,33 +311,33 @@ partial class Composition " }\n" + " Service *-- Dependency : IDependency\n" + " Composition ..> Dependency : IDependency DependencySingleton\n" + - " Composition ..> Service : IService RootM03D11di0002\n" + + " Composition ..> Service : IService RootM03D12di0002\n" + " Composition ..> OtherService : \"Other\" IService OtherService"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - var valResolverM03D11di_0001 = new ResolverM03D11di_0001(); - ResolverM03D11di.Value = valResolverM03D11di_0001; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + var valResolverM03D12di_0001 = new ResolverM03D12di_0001(); + ResolverM03D12di.Value = valResolverM03D12di_0001; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ResolveScenario.IDependency), valResolverM03D11di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ResolveScenario.IService), valResolverM03D11di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ResolveScenario.IDependency), valResolverM03D12di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ResolveScenario.IService), valResolverM03D12di_0001) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -350,7 +350,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.ResolveScenario.IDependency Resolve(Composition composition) { @@ -368,11 +368,11 @@ partial class Composition } } - private sealed class ResolverM03D11di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.ResolveScenario.IService Resolve(Composition composition) { - return composition.RootM03D11di0002; + return composition.RootM03D12di0002; } public Pure.DI.UsageTests.Basics.ResolveScenario.IService ResolveByTag(Composition composition, object tag) @@ -382,7 +382,7 @@ partial class Composition case "Other": return composition.OtherService; case null: - return composition.RootM03D11di0002; + return composition.RootM03D12di0002; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.ResolveScenario.IService."); } diff --git a/readme/root-arguments.md b/readme/root-arguments.md index aa12651ec..1647fbc33 100644 --- a/readme/root-arguments.md +++ b/readme/root-arguments.md @@ -105,9 +105,10 @@ classDiagram /// /// /// -/// CreateService +/// CreateService /// /// +/// Provides a composition root of type . /// /// /// @@ -126,14 +127,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This parameterized constructor creates a new instance of with arguments. /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -142,7 +143,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots diff --git a/readme/scope.md b/readme/scope.md index ed6879eca..e23be8b8d 100644 --- a/readme/scope.md +++ b/readme/scope.md @@ -143,7 +143,7 @@ classDiagram /// /// /// -/// SessionRoot +/// SessionRoot /// /// /// Session composition root @@ -165,20 +165,20 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition: global::System.IDisposable { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; - private readonly global::System.IDisposable[] _disposablesM03D11di; - private int _disposeIndexM03D11di; - private Pure.DI.UsageTests.Lifetimes.ScopeScenario.Dependency _scopedM03D11di34_Dependency; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; + private readonly global::System.IDisposable[] _disposablesM03D12di; + private int _disposeIndexM03D12di; + private Pure.DI.UsageTests.Lifetimes.ScopeScenario.Dependency _scopedM03D12di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); - _disposablesM03D11di = new global::System.IDisposable[1]; + _rootM03D12di = this; + _lockM03D12di = new object(); + _disposablesM03D12di = new global::System.IDisposable[1]; } /// @@ -187,9 +187,9 @@ partial class Composition: global::System.IDisposable /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; - _disposablesM03D11di = new global::System.IDisposable[1]; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; + _disposablesM03D12di = new global::System.IDisposable[1]; } #region Composition Roots @@ -203,18 +203,18 @@ partial class Composition: global::System.IDisposable #endif get { - if (ReferenceEquals(_scopedM03D11di34_Dependency, null)) + if (ReferenceEquals(_scopedM03D12di34_Dependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_scopedM03D11di34_Dependency, null)) + if (ReferenceEquals(_scopedM03D12di34_Dependency, null)) { - _scopedM03D11di34_Dependency = new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Dependency(); - _disposablesM03D11di[_disposeIndexM03D11di++] = _scopedM03D11di34_Dependency; + _scopedM03D12di34_Dependency = new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Dependency(); + _disposablesM03D12di[_disposeIndexM03D12di++] = _scopedM03D12di34_Dependency; } } } - return new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Service(_scopedM03D11di34_Dependency); + return new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Service(_scopedM03D12di34_Dependency); } } @@ -228,16 +228,16 @@ partial class Composition: global::System.IDisposable #endif get { - var perResolveM03D11di40_Func = default(System.Func); - perResolveM03D11di40_Func = new global::System.Func( + var perResolveM03D12di40_Func = default(System.Func); + perResolveM03D12di40_Func = new global::System.Func( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - var transientM03D11di2_Composition = this; - var factory_M03D11di1 = new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Session(transientM03D11di2_Composition); - return factory_M03D11di1; + var transientM03D12di2_Composition = this; + var factory_M03D12di1 = new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Session(transientM03D12di2_Composition); + return factory_M03D12di1; }); - return new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Program(perResolveM03D11di40_Func); + return new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Program(perResolveM03D12di40_Func); } } #endregion @@ -253,7 +253,7 @@ partial class Composition: global::System.IDisposable #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -267,7 +267,7 @@ partial class Composition: global::System.IDisposable #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -280,10 +280,10 @@ partial class Composition: global::System.IDisposable #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -304,10 +304,10 @@ partial class Composition: global::System.IDisposable #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -324,11 +324,11 @@ partial class Composition: global::System.IDisposable /// public void Dispose() { - lock (_lockM03D11di) + lock (_lockM03D12di) { - while (_disposeIndexM03D11di > 0) + while (_disposeIndexM03D12di > 0) { - var disposableInstance = _disposablesM03D11di[--_disposeIndexM03D11di]; + var disposableInstance = _disposablesM03D12di[--_disposeIndexM03D12di]; try { disposableInstance.Dispose(); @@ -339,7 +339,7 @@ partial class Composition: global::System.IDisposable } } - _scopedM03D11di34_Dependency = null; + _scopedM03D12di34_Dependency = null; } } @@ -391,29 +391,29 @@ partial class Composition: global::System.IDisposable " FuncᐸSessionᐳ *-- Session : Session"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - var valResolverM03D11di_0001 = new ResolverM03D11di_0001(); - ResolverM03D11di.Value = valResolverM03D11di_0001; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + var valResolverM03D12di_0001 = new ResolverM03D12di_0001(); + ResolverM03D12di.Value = valResolverM03D12di_0001; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.ScopeScenario.IService), valResolverM03D11di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.ScopeScenario.Program), valResolverM03D11di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.ScopeScenario.IService), valResolverM03D12di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.ScopeScenario.Program), valResolverM03D12di_0001) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -426,7 +426,7 @@ partial class Composition: global::System.IDisposable } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Lifetimes.ScopeScenario.IService Resolve(Composition composition) { @@ -444,7 +444,7 @@ partial class Composition: global::System.IDisposable } } - private sealed class ResolverM03D11di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Lifetimes.ScopeScenario.Program Resolve(Composition composition) { diff --git a/readme/service-collection.md b/readme/service-collection.md index fe330f7b8..2456a0071 100644 --- a/readme/service-collection.md +++ b/readme/service-collection.md @@ -47,8 +47,8 @@ service.Dependency.ShouldBe(dependency); ```mermaid classDiagram class Composition { - -IDependency RootM03D11di0001 - -IService RootM03D11di0002 + -IDependency RootM03D12di0001 + -IService RootM03D12di0002 + T ResolveᐸTᐳ() + T ResolveᐸTᐳ(object? tag) + object Resolve(Type type) @@ -69,8 +69,8 @@ classDiagram <> } Service o-- "Singleton" Dependency : "Dependency Key" IDependency - Composition ..> Dependency : "Dependency Key" IDependency RootM03D11di0001 - Composition ..> Service : IService RootM03D11di0002 + Composition ..> Dependency : "Dependency Key" IDependency RootM03D12di0001 + Composition ..> Service : IService RootM03D12di0002 ``` @@ -88,38 +88,40 @@ classDiagram /// /// /// -/// is a private composition root that can be resolved by methods like . +/// is a private composition root that can be resolved by methods like . /// /// +/// Provides a composition root of type . /// /// /// /// -/// is a private composition root that can be resolved by methods like . +/// is a private composition root that can be resolved by methods like . /// /// +/// Provides a composition root of type . /// /// /// /// -/// Class diagram
+/// Class diagram
/// This class was created by Pure.DI source code generator. ///
/// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; - private Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Dependency _singletonM03D11di34_Dependency; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; + private Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Dependency _singletonM03D12di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -128,52 +130,52 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots - public Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IDependency RootM03D11di0001 + public Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IDependency RootM03D12di0001 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - _singletonM03D11di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Dependency(); - _rootM03D11di._singletonM03D11di34_Dependency = _singletonM03D11di34_Dependency; + _singletonM03D12di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Dependency(); + _rootM03D12di._singletonM03D12di34_Dependency = _singletonM03D12di34_Dependency; } } } - return _rootM03D11di._singletonM03D11di34_Dependency; + return _rootM03D12di._singletonM03D12di34_Dependency; } } - public Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IService RootM03D11di0002 + public Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IService RootM03D12di0002 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - _singletonM03D11di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Dependency(); - _rootM03D11di._singletonM03D11di34_Dependency = _singletonM03D11di34_Dependency; + _singletonM03D12di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Dependency(); + _rootM03D12di._singletonM03D12di34_Dependency = _singletonM03D12di34_Dependency; } } } - return new Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Service(_rootM03D11di._singletonM03D11di34_Dependency); + return new Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Service(_rootM03D12di._singletonM03D12di34_Dependency); } } #endregion @@ -189,7 +191,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -203,7 +205,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -216,10 +218,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -240,10 +242,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -262,8 +264,8 @@ partial class Composition return "classDiagram\n" + " class Composition {\n" + - " -IDependency RootM03D11di0001\n" + - " -IService RootM03D11di0002\n" + + " -IDependency RootM03D12di0001\n" + + " -IService RootM03D12di0002\n" + " + T ResolveᐸTᐳ()\n" + " + T ResolveᐸTᐳ(object? tag)\n" + " + object Resolve(Type type)\n" + @@ -284,35 +286,35 @@ partial class Composition " <>\n" + " }\n" + " Service o-- \"Singleton\" Dependency : \"Dependency Key\" IDependency\n" + - " Composition ..> Dependency : \"Dependency Key\" IDependency RootM03D11di0001\n" + - " Composition ..> Service : IService RootM03D11di0002"; + " Composition ..> Dependency : \"Dependency Key\" IDependency RootM03D12di0001\n" + + " Composition ..> Service : IService RootM03D12di0002"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - OnNewRoot(valResolverM03D11di_0000, "RootM03D11di0001", "Dependency Key", Pure.DI.Lifetime.Singleton); - ResolverM03D11di.Value = valResolverM03D11di_0000; - var valResolverM03D11di_0001 = new ResolverM03D11di_0001(); - OnNewRoot(valResolverM03D11di_0001, "RootM03D11di0002", null, Pure.DI.Lifetime.Transient); - ResolverM03D11di.Value = valResolverM03D11di_0001; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + OnNewRoot(valResolverM03D12di_0000, "RootM03D12di0001", "Dependency Key", Pure.DI.Lifetime.Singleton); + ResolverM03D12di.Value = valResolverM03D12di_0000; + var valResolverM03D12di_0001 = new ResolverM03D12di_0001(); + OnNewRoot(valResolverM03D12di_0001, "RootM03D12di0002", null, Pure.DI.Lifetime.Transient); + ResolverM03D12di.Value = valResolverM03D12di_0001; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IDependency), valResolverM03D11di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IService), valResolverM03D11di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IDependency), valResolverM03D12di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IService), valResolverM03D12di_0001) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -325,7 +327,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IDependency Resolve(Composition composition) { @@ -337,17 +339,17 @@ partial class Composition switch (tag) { case "Dependency Key": - return composition.RootM03D11di0001; + return composition.RootM03D12di0001; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IDependency."); } } - private sealed class ResolverM03D11di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IService Resolve(Composition composition) { - return composition.RootM03D11di0002; + return composition.RootM03D12di0002; } public Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IService ResolveByTag(Composition composition, object tag) @@ -355,7 +357,7 @@ partial class Composition switch (tag) { case null: - return composition.RootM03D11di0002; + return composition.RootM03D12di0002; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IService."); } diff --git a/readme/service-provider-with-scope.md b/readme/service-provider-with-scope.md index d05c91ff0..90dc4b9a6 100644 --- a/readme/service-provider-with-scope.md +++ b/readme/service-provider-with-scope.md @@ -73,8 +73,8 @@ dependency1.ShouldBe(dependency2); ```mermaid classDiagram class Composition { - -IDependency RootM03D11di0001 - -IService RootM03D11di0002 + -IDependency RootM03D12di0001 + -IService RootM03D12di0002 + T ResolveᐸTᐳ() + T ResolveᐸTᐳ(object? tag) + object GetService(Type type) @@ -96,8 +96,8 @@ classDiagram <> } Service o-- "Singleton" Dependency : IDependency - Composition ..> Dependency : IDependency RootM03D11di0001 - Composition ..> Service : IService RootM03D11di0002 + Composition ..> Dependency : IDependency RootM03D12di0001 + Composition ..> Service : IService RootM03D12di0002 ``` @@ -120,42 +120,44 @@ classDiagram /// /// /// -/// is a private composition root that can be resolved by methods like . +/// is a private composition root that can be resolved by methods like . /// /// +/// Provides a composition root of type . /// /// /// /// -/// is a private composition root that can be resolved by methods like . +/// is a private composition root that can be resolved by methods like . /// /// +/// Provides a composition root of type . /// /// /// /// -/// Class diagram
+/// Class diagram
/// This class was created by Pure.DI source code generator. ///
/// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition: global::System.IDisposable { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; - private readonly global::System.IDisposable[] _disposablesM03D11di; - private int _disposeIndexM03D11di; - private Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Dependency _singletonM03D11di34_Dependency; - private Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Service _scopedM03D11di35_Service; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; + private readonly global::System.IDisposable[] _disposablesM03D12di; + private int _disposeIndexM03D12di; + private Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Dependency _singletonM03D12di34_Dependency; + private Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Service _scopedM03D12di35_Service; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); - _disposablesM03D11di = new global::System.IDisposable[1]; + _rootM03D12di = this; + _lockM03D12di = new object(); + _disposablesM03D12di = new global::System.IDisposable[1]; } /// @@ -164,58 +166,58 @@ partial class Composition: global::System.IDisposable /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; - _disposablesM03D11di = new global::System.IDisposable[1]; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; + _disposablesM03D12di = new global::System.IDisposable[1]; } #region Composition Roots - public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency RootM03D11di0001 + public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency RootM03D12di0001 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - _singletonM03D11di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Dependency(); - _rootM03D11di._singletonM03D11di34_Dependency = _singletonM03D11di34_Dependency; + _singletonM03D12di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Dependency(); + _rootM03D12di._singletonM03D12di34_Dependency = _singletonM03D12di34_Dependency; } } } - return _rootM03D11di._singletonM03D11di34_Dependency; + return _rootM03D12di._singletonM03D12di34_Dependency; } } - public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IService RootM03D11di0002 + public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IService RootM03D12di0002 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_scopedM03D11di35_Service, null)) + if (ReferenceEquals(_scopedM03D12di35_Service, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_scopedM03D11di35_Service, null)) + if (ReferenceEquals(_scopedM03D12di35_Service, null)) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - _singletonM03D11di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Dependency(); - _rootM03D11di._singletonM03D11di34_Dependency = _singletonM03D11di34_Dependency; + _singletonM03D12di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Dependency(); + _rootM03D12di._singletonM03D12di34_Dependency = _singletonM03D12di34_Dependency; } - _scopedM03D11di35_Service = new Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Service(_rootM03D11di._singletonM03D11di34_Dependency); - _disposablesM03D11di[_disposeIndexM03D11di++] = _scopedM03D11di35_Service; + _scopedM03D12di35_Service = new Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Service(_rootM03D12di._singletonM03D12di34_Dependency); + _disposablesM03D12di[_disposeIndexM03D12di++] = _scopedM03D12di35_Service; } } } - return _scopedM03D11di35_Service; + return _scopedM03D12di35_Service; } } #endregion @@ -231,7 +233,7 @@ partial class Composition: global::System.IDisposable #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -245,7 +247,7 @@ partial class Composition: global::System.IDisposable #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -258,10 +260,10 @@ partial class Composition: global::System.IDisposable #endif public object GetService(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -282,10 +284,10 @@ partial class Composition: global::System.IDisposable #endif public object GetRequiredKeyedService(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -302,11 +304,11 @@ partial class Composition: global::System.IDisposable /// public void Dispose() { - lock (_lockM03D11di) + lock (_lockM03D12di) { - while (_disposeIndexM03D11di > 0) + while (_disposeIndexM03D12di > 0) { - var disposableInstance = _disposablesM03D11di[--_disposeIndexM03D11di]; + var disposableInstance = _disposablesM03D12di[--_disposeIndexM03D12di]; try { disposableInstance.Dispose(); @@ -317,8 +319,8 @@ partial class Composition: global::System.IDisposable } } - _singletonM03D11di34_Dependency = null; - _scopedM03D11di35_Service = null; + _singletonM03D12di34_Dependency = null; + _scopedM03D12di35_Service = null; } } @@ -332,8 +334,8 @@ partial class Composition: global::System.IDisposable return "classDiagram\n" + " class Composition {\n" + - " -IDependency RootM03D11di0001\n" + - " -IService RootM03D11di0002\n" + + " -IDependency RootM03D12di0001\n" + + " -IService RootM03D12di0002\n" + " + T ResolveᐸTᐳ()\n" + " + T ResolveᐸTᐳ(object? tag)\n" + " + object GetService(Type type)\n" + @@ -355,33 +357,33 @@ partial class Composition: global::System.IDisposable " <>\n" + " }\n" + " Service o-- \"Singleton\" Dependency : IDependency\n" + - " Composition ..> Dependency : IDependency RootM03D11di0001\n" + - " Composition ..> Service : IService RootM03D11di0002"; + " Composition ..> Dependency : IDependency RootM03D12di0001\n" + + " Composition ..> Service : IService RootM03D12di0002"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - var valResolverM03D11di_0001 = new ResolverM03D11di_0001(); - ResolverM03D11di.Value = valResolverM03D11di_0001; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + var valResolverM03D12di_0001 = new ResolverM03D12di_0001(); + ResolverM03D12di.Value = valResolverM03D12di_0001; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency), valResolverM03D11di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IService), valResolverM03D11di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency), valResolverM03D12di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IService), valResolverM03D12di_0001) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -394,11 +396,11 @@ partial class Composition: global::System.IDisposable } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency Resolve(Composition composition) { - return composition.RootM03D11di0001; + return composition.RootM03D12di0001; } public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency ResolveByTag(Composition composition, object tag) @@ -406,17 +408,17 @@ partial class Composition: global::System.IDisposable switch (tag) { case null: - return composition.RootM03D11di0001; + return composition.RootM03D12di0001; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency."); } } - private sealed class ResolverM03D11di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IService Resolve(Composition composition) { - return composition.RootM03D11di0002; + return composition.RootM03D12di0002; } public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IService ResolveByTag(Composition composition, object tag) @@ -424,7 +426,7 @@ partial class Composition: global::System.IDisposable switch (tag) { case null: - return composition.RootM03D11di0002; + return composition.RootM03D12di0002; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IService."); } diff --git a/readme/service-provider.md b/readme/service-provider.md index c9dd3b17a..cdbd38bdb 100644 --- a/readme/service-provider.md +++ b/readme/service-provider.md @@ -45,8 +45,8 @@ service.Dependency.ShouldBe(dependency); ```mermaid classDiagram class Composition { - -IDependency RootM03D11di0001 - -IService RootM03D11di0002 + -IDependency RootM03D12di0001 + -IService RootM03D12di0002 + T ResolveᐸTᐳ() + T ResolveᐸTᐳ(object? tag) + object GetService(Type type) @@ -67,8 +67,8 @@ classDiagram <> } Service o-- "Singleton" Dependency : IDependency - Composition ..> Dependency : IDependency RootM03D11di0001 - Composition ..> Service : IService RootM03D11di0002 + Composition ..> Dependency : IDependency RootM03D12di0001 + Composition ..> Service : IService RootM03D12di0002 ``` @@ -86,38 +86,40 @@ classDiagram /// /// /// -/// is a private composition root that can be resolved by methods like . +/// is a private composition root that can be resolved by methods like . /// /// +/// Provides a composition root of type . /// /// /// /// -/// is a private composition root that can be resolved by methods like . +/// is a private composition root that can be resolved by methods like . /// /// +/// Provides a composition root of type . /// /// /// /// -/// Class diagram
+/// Class diagram
/// This class was created by Pure.DI source code generator. ///
/// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; - private Pure.DI.UsageTests.BCL.ServiceProviderScenario.Dependency _singletonM03D11di34_Dependency; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; + private Pure.DI.UsageTests.BCL.ServiceProviderScenario.Dependency _singletonM03D12di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -126,52 +128,52 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots - public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency RootM03D11di0001 + public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency RootM03D12di0001 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - _singletonM03D11di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderScenario.Dependency(); - _rootM03D11di._singletonM03D11di34_Dependency = _singletonM03D11di34_Dependency; + _singletonM03D12di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderScenario.Dependency(); + _rootM03D12di._singletonM03D12di34_Dependency = _singletonM03D12di34_Dependency; } } } - return _rootM03D11di._singletonM03D11di34_Dependency; + return _rootM03D12di._singletonM03D12di34_Dependency; } } - public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService RootM03D11di0002 + public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService RootM03D12di0002 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - _singletonM03D11di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderScenario.Dependency(); - _rootM03D11di._singletonM03D11di34_Dependency = _singletonM03D11di34_Dependency; + _singletonM03D12di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderScenario.Dependency(); + _rootM03D12di._singletonM03D12di34_Dependency = _singletonM03D12di34_Dependency; } } } - return new Pure.DI.UsageTests.BCL.ServiceProviderScenario.Service(_rootM03D11di._singletonM03D11di34_Dependency); + return new Pure.DI.UsageTests.BCL.ServiceProviderScenario.Service(_rootM03D12di._singletonM03D12di34_Dependency); } } #endregion @@ -187,7 +189,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -201,7 +203,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -214,10 +216,10 @@ partial class Composition #endif public object GetService(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -238,10 +240,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -260,8 +262,8 @@ partial class Composition return "classDiagram\n" + " class Composition {\n" + - " -IDependency RootM03D11di0001\n" + - " -IService RootM03D11di0002\n" + + " -IDependency RootM03D12di0001\n" + + " -IService RootM03D12di0002\n" + " + T ResolveᐸTᐳ()\n" + " + T ResolveᐸTᐳ(object? tag)\n" + " + object GetService(Type type)\n" + @@ -282,33 +284,33 @@ partial class Composition " <>\n" + " }\n" + " Service o-- \"Singleton\" Dependency : IDependency\n" + - " Composition ..> Dependency : IDependency RootM03D11di0001\n" + - " Composition ..> Service : IService RootM03D11di0002"; + " Composition ..> Dependency : IDependency RootM03D12di0001\n" + + " Composition ..> Service : IService RootM03D12di0002"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - var valResolverM03D11di_0001 = new ResolverM03D11di_0001(); - ResolverM03D11di.Value = valResolverM03D11di_0001; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + var valResolverM03D12di_0001 = new ResolverM03D12di_0001(); + ResolverM03D12di.Value = valResolverM03D12di_0001; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency), valResolverM03D11di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService), valResolverM03D11di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency), valResolverM03D12di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService), valResolverM03D12di_0001) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -321,11 +323,11 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency Resolve(Composition composition) { - return composition.RootM03D11di0001; + return composition.RootM03D12di0001; } public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency ResolveByTag(Composition composition, object tag) @@ -333,17 +335,17 @@ partial class Composition switch (tag) { case null: - return composition.RootM03D11di0001; + return composition.RootM03D12di0001; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency."); } } - private sealed class ResolverM03D11di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService Resolve(Composition composition) { - return composition.RootM03D11di0002; + return composition.RootM03D12di0002; } public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService ResolveByTag(Composition composition, object tag) @@ -351,7 +353,7 @@ partial class Composition switch (tag) { case null: - return composition.RootM03D11di0002; + return composition.RootM03D12di0002; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService."); } diff --git a/readme/simplified-binding.md b/readme/simplified-binding.md index 2b8491d1f..75f44ea8d 100644 --- a/readme/simplified-binding.md +++ b/readme/simplified-binding.md @@ -119,14 +119,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -135,7 +135,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -149,8 +149,8 @@ partial class Composition #endif get { - var perBlockM03D11di1_Dependency = new Pure.DI.UsageTests.Basics.SimplifiedBindingScenario.Dependency(); - return new Pure.DI.UsageTests.Basics.SimplifiedBindingScenario.Service(perBlockM03D11di1_Dependency, perBlockM03D11di1_Dependency, perBlockM03D11di1_Dependency); + var perBlockM03D12di1_Dependency = new Pure.DI.UsageTests.Basics.SimplifiedBindingScenario.Dependency(); + return new Pure.DI.UsageTests.Basics.SimplifiedBindingScenario.Service(perBlockM03D12di1_Dependency, perBlockM03D12di1_Dependency, perBlockM03D12di1_Dependency); } } #endregion diff --git a/readme/singleton.md b/readme/singleton.md index f77f99dfc..3e4a794f7 100644 --- a/readme/singleton.md +++ b/readme/singleton.md @@ -83,9 +83,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -104,17 +105,17 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; - private Pure.DI.UsageTests.Lifetimes.SingletonScenario.Dependency _singletonM03D11di34_Dependency; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; + private Pure.DI.UsageTests.Lifetimes.SingletonScenario.Dependency _singletonM03D12di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -123,8 +124,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots @@ -135,18 +136,18 @@ partial class Composition #endif get { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di34_Dependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di34_Dependency, null)) { - _singletonM03D11di34_Dependency = new Pure.DI.UsageTests.Lifetimes.SingletonScenario.Dependency(); - _rootM03D11di._singletonM03D11di34_Dependency = _singletonM03D11di34_Dependency; + _singletonM03D12di34_Dependency = new Pure.DI.UsageTests.Lifetimes.SingletonScenario.Dependency(); + _rootM03D12di._singletonM03D12di34_Dependency = _singletonM03D12di34_Dependency; } } } - return new Pure.DI.UsageTests.Lifetimes.SingletonScenario.Service(_singletonM03D11di34_Dependency, _rootM03D11di._singletonM03D11di34_Dependency); + return new Pure.DI.UsageTests.Lifetimes.SingletonScenario.Service(_singletonM03D12di34_Dependency, _rootM03D12di._singletonM03D12di34_Dependency); } } #endregion @@ -162,7 +163,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -176,7 +177,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -189,10 +190,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -213,10 +214,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -260,26 +261,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.SingletonScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.SingletonScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -292,7 +293,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Lifetimes.SingletonScenario.IService Resolve(Composition composition) { diff --git a/readme/span-and-readonlyspan.md b/readme/span-and-readonlyspan.md index c0ccc5cf3..0c0fca39b 100644 --- a/readme/span-and-readonlyspan.md +++ b/readme/span-and-readonlyspan.md @@ -85,9 +85,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -106,14 +107,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -122,7 +123,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -133,13 +134,13 @@ partial class Composition #endif get { - System.ReadOnlySpan transientM03D11di1_ReadOnlySpan = stackalloc Pure.DI.UsageTests.BCL.SpanScenario.Dependency[3] + System.ReadOnlySpan transientM03D12di1_ReadOnlySpan = stackalloc Pure.DI.UsageTests.BCL.SpanScenario.Dependency[3] { new Pure.DI.UsageTests.BCL.SpanScenario.Dependency(), new Pure.DI.UsageTests.BCL.SpanScenario.Dependency(), new Pure.DI.UsageTests.BCL.SpanScenario.Dependency() }; - return new Pure.DI.UsageTests.BCL.SpanScenario.Service(transientM03D11di1_ReadOnlySpan); + return new Pure.DI.UsageTests.BCL.SpanScenario.Service(transientM03D12di1_ReadOnlySpan); } } #endregion @@ -155,7 +156,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -169,7 +170,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -182,10 +183,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -206,10 +207,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -252,26 +253,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.SpanScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.SpanScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -284,7 +285,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.SpanScenario.IService Resolve(Composition composition) { diff --git a/readme/tag-attribute.md b/readme/tag-attribute.md index 0b23d6fd4..1f1abb001 100644 --- a/readme/tag-attribute.md +++ b/readme/tag-attribute.md @@ -93,9 +93,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -114,14 +115,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -130,7 +131,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -157,7 +158,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -171,7 +172,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -184,10 +185,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -208,10 +209,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -259,26 +260,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagAttributeScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagAttributeScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -291,7 +292,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.TagAttributeScenario.IService Resolve(Composition composition) { diff --git a/readme/tag-type.md b/readme/tag-type.md index 6e090443f..0203cd3da 100644 --- a/readme/tag-type.md +++ b/readme/tag-type.md @@ -106,14 +106,15 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// /// -/// XyzRoot +/// XyzRoot /// /// /// "XyzRoot" is root name, typeof(XyzDependency) is tag @@ -135,17 +136,17 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; - private Pure.DI.UsageTests.Basics.TagTypeScenario.XyzDependency _singletonM03D11di35_XyzDependency; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; + private Pure.DI.UsageTests.Basics.TagTypeScenario.XyzDependency _singletonM03D12di35_XyzDependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -154,8 +155,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots @@ -169,18 +170,18 @@ partial class Composition #endif get { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di35_XyzDependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di35_XyzDependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di35_XyzDependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di35_XyzDependency, null)) { - _singletonM03D11di35_XyzDependency = new Pure.DI.UsageTests.Basics.TagTypeScenario.XyzDependency(); - _rootM03D11di._singletonM03D11di35_XyzDependency = _singletonM03D11di35_XyzDependency; + _singletonM03D12di35_XyzDependency = new Pure.DI.UsageTests.Basics.TagTypeScenario.XyzDependency(); + _rootM03D12di._singletonM03D12di35_XyzDependency = _singletonM03D12di35_XyzDependency; } } } - return _rootM03D11di._singletonM03D11di35_XyzDependency; + return _rootM03D12di._singletonM03D12di35_XyzDependency; } } @@ -191,18 +192,18 @@ partial class Composition #endif get { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di35_XyzDependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di35_XyzDependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di35_XyzDependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di35_XyzDependency, null)) { - _singletonM03D11di35_XyzDependency = new Pure.DI.UsageTests.Basics.TagTypeScenario.XyzDependency(); - _rootM03D11di._singletonM03D11di35_XyzDependency = _singletonM03D11di35_XyzDependency; + _singletonM03D12di35_XyzDependency = new Pure.DI.UsageTests.Basics.TagTypeScenario.XyzDependency(); + _rootM03D12di._singletonM03D12di35_XyzDependency = _singletonM03D12di35_XyzDependency; } } } - return new Pure.DI.UsageTests.Basics.TagTypeScenario.Service(new Pure.DI.UsageTests.Basics.TagTypeScenario.AbcDependency(), _rootM03D11di._singletonM03D11di35_XyzDependency, new Pure.DI.UsageTests.Basics.TagTypeScenario.AbcDependency()); + return new Pure.DI.UsageTests.Basics.TagTypeScenario.Service(new Pure.DI.UsageTests.Basics.TagTypeScenario.AbcDependency(), _rootM03D12di._singletonM03D12di35_XyzDependency, new Pure.DI.UsageTests.Basics.TagTypeScenario.AbcDependency()); } } #endregion @@ -218,7 +219,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -232,7 +233,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -245,10 +246,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -269,10 +270,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -324,29 +325,29 @@ partial class Composition " Composition ..> XyzDependency : typeof(Pure.DI.UsageTests.Basics.TagTypeScenario.XyzDependency) IDependency XyzRoot"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - var valResolverM03D11di_0001 = new ResolverM03D11di_0001(); - ResolverM03D11di.Value = valResolverM03D11di_0001; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + var valResolverM03D12di_0001 = new ResolverM03D12di_0001(); + ResolverM03D12di.Value = valResolverM03D12di_0001; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagTypeScenario.IDependency), valResolverM03D11di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagTypeScenario.IService), valResolverM03D11di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagTypeScenario.IDependency), valResolverM03D12di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagTypeScenario.IService), valResolverM03D12di_0001) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -359,7 +360,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.TagTypeScenario.IDependency Resolve(Composition composition) { @@ -376,7 +377,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.TagTypeScenario.IService Resolve(Composition composition) { diff --git a/readme/tag-unique.md b/readme/tag-unique.md index 606741d40..fb665b05e 100644 --- a/readme/tag-unique.md +++ b/readme/tag-unique.md @@ -46,11 +46,11 @@ classDiagram + object Resolve(Type type, object? tag) } class IEnumerableᐸIDependencyᐸStringᐳᐳ - AbcDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : 6004fc06-58ad-4487-8e5c-22b1a69050c8 + AbcDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : 545495d7-7038-4257-bedd-92a03cf2d43a class AbcDependencyᐸStringᐳ { +AbcDependency() } - XyzDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : f87d1729-2234-466f-833f-d6cbde5dde78 + XyzDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : c4091ca0-2d4d-4c77-8a4c-43d86861f3ba class XyzDependencyᐸStringᐳ { +XyzDependency() } @@ -64,8 +64,8 @@ classDiagram class IServiceᐸStringᐳ { <> } - IEnumerableᐸIDependencyᐸStringᐳᐳ *-- AbcDependencyᐸStringᐳ : 6004fc06-58ad-4487-8e5c-22b1a69050c8 IDependencyᐸStringᐳ - IEnumerableᐸIDependencyᐸStringᐳᐳ *-- XyzDependencyᐸStringᐳ : f87d1729-2234-466f-833f-d6cbde5dde78 IDependencyᐸStringᐳ + IEnumerableᐸIDependencyᐸStringᐳᐳ *-- AbcDependencyᐸStringᐳ : 545495d7-7038-4257-bedd-92a03cf2d43a IDependencyᐸStringᐳ + IEnumerableᐸIDependencyᐸStringᐳᐳ *-- XyzDependencyᐸStringᐳ : c4091ca0-2d4d-4c77-8a4c-43d86861f3ba IDependencyᐸStringᐳ Composition ..> ServiceᐸStringᐳ : IServiceᐸStringᐳ Root ServiceᐸStringᐳ o-- "PerBlock" IEnumerableᐸIDependencyᐸStringᐳᐳ : IEnumerableᐸIDependencyᐸStringᐳᐳ ``` @@ -85,35 +85,36 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// /// /// -/// This shows how to get an instance of type using the composition root : +/// This shows how to get an instance of type using the composition root : /// /// var composition = new Composition(); /// var instance = composition.Root; /// /// -/// Class diagram
+/// Class diagram
/// This class was created by Pure.DI source code generator. ///
/// [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -122,7 +123,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -134,13 +135,13 @@ partial class Composition get { [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)0x200)] - System.Collections.Generic.IEnumerable> LocalperBlockM03D11di1_IEnumerable() + System.Collections.Generic.IEnumerable> LocalperBlockM03D12di1_IEnumerable() { yield return new Pure.DI.UsageTests.Basics.TagUniqueScenario.AbcDependency(); yield return new Pure.DI.UsageTests.Basics.TagUniqueScenario.XyzDependency(); } - var perBlockM03D11di1_IEnumerable = LocalperBlockM03D11di1_IEnumerable(); - return new Pure.DI.UsageTests.Basics.TagUniqueScenario.Service(perBlockM03D11di1_IEnumerable); + var perBlockM03D12di1_IEnumerable = LocalperBlockM03D12di1_IEnumerable(); + return new Pure.DI.UsageTests.Basics.TagUniqueScenario.Service(perBlockM03D12di1_IEnumerable); } } #endregion @@ -156,7 +157,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -170,7 +171,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -183,10 +184,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -207,10 +208,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -236,11 +237,11 @@ partial class Composition " + object Resolve(Type type, object? tag)\n" + " }\n" + " class IEnumerableᐸIDependencyᐸStringᐳᐳ\n" + - " AbcDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : 6004fc06-58ad-4487-8e5c-22b1a69050c8 \n" + + " AbcDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : 545495d7-7038-4257-bedd-92a03cf2d43a \n" + " class AbcDependencyᐸStringᐳ {\n" + " +AbcDependency()\n" + " }\n" + - " XyzDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : f87d1729-2234-466f-833f-d6cbde5dde78 \n" + + " XyzDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : c4091ca0-2d4d-4c77-8a4c-43d86861f3ba \n" + " class XyzDependencyᐸStringᐳ {\n" + " +XyzDependency()\n" + " }\n" + @@ -254,32 +255,32 @@ partial class Composition " class IServiceᐸStringᐳ {\n" + " <>\n" + " }\n" + - " IEnumerableᐸIDependencyᐸStringᐳᐳ *-- AbcDependencyᐸStringᐳ : 6004fc06-58ad-4487-8e5c-22b1a69050c8 IDependencyᐸStringᐳ\n" + - " IEnumerableᐸIDependencyᐸStringᐳᐳ *-- XyzDependencyᐸStringᐳ : f87d1729-2234-466f-833f-d6cbde5dde78 IDependencyᐸStringᐳ\n" + + " IEnumerableᐸIDependencyᐸStringᐳᐳ *-- AbcDependencyᐸStringᐳ : 545495d7-7038-4257-bedd-92a03cf2d43a IDependencyᐸStringᐳ\n" + + " IEnumerableᐸIDependencyᐸStringᐳᐳ *-- XyzDependencyᐸStringᐳ : c4091ca0-2d4d-4c77-8a4c-43d86861f3ba IDependencyᐸStringᐳ\n" + " Composition ..> ServiceᐸStringᐳ : IServiceᐸStringᐳ Root\n" + " ServiceᐸStringᐳ o-- \"PerBlock\" IEnumerableᐸIDependencyᐸStringᐳᐳ : IEnumerableᐸIDependencyᐸStringᐳᐳ"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di>.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di>.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagUniqueScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagUniqueScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -292,7 +293,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver> + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver> { public Pure.DI.UsageTests.Basics.TagUniqueScenario.IService Resolve(Composition composition) { diff --git a/readme/tags.md b/readme/tags.md index 94e39344c..3caa93cb9 100644 --- a/readme/tags.md +++ b/readme/tags.md @@ -108,14 +108,15 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// /// -/// XyzRoot +/// XyzRoot /// /// /// "XyzRoot" is root name, "Xyz" is tag @@ -137,17 +138,17 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; - private Pure.DI.UsageTests.Basics.TagsScenario.XyzDependency _singletonM03D11di35_XyzDependency; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; + private Pure.DI.UsageTests.Basics.TagsScenario.XyzDependency _singletonM03D12di35_XyzDependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -156,8 +157,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots @@ -171,18 +172,18 @@ partial class Composition #endif get { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di35_XyzDependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di35_XyzDependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di35_XyzDependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di35_XyzDependency, null)) { - _singletonM03D11di35_XyzDependency = new Pure.DI.UsageTests.Basics.TagsScenario.XyzDependency(); - _rootM03D11di._singletonM03D11di35_XyzDependency = _singletonM03D11di35_XyzDependency; + _singletonM03D12di35_XyzDependency = new Pure.DI.UsageTests.Basics.TagsScenario.XyzDependency(); + _rootM03D12di._singletonM03D12di35_XyzDependency = _singletonM03D12di35_XyzDependency; } } } - return _rootM03D11di._singletonM03D11di35_XyzDependency; + return _rootM03D12di._singletonM03D12di35_XyzDependency; } } @@ -193,18 +194,18 @@ partial class Composition #endif get { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di35_XyzDependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di35_XyzDependency, null)) { - lock (_lockM03D11di) + lock (_lockM03D12di) { - if (ReferenceEquals(_rootM03D11di._singletonM03D11di35_XyzDependency, null)) + if (ReferenceEquals(_rootM03D12di._singletonM03D12di35_XyzDependency, null)) { - _singletonM03D11di35_XyzDependency = new Pure.DI.UsageTests.Basics.TagsScenario.XyzDependency(); - _rootM03D11di._singletonM03D11di35_XyzDependency = _singletonM03D11di35_XyzDependency; + _singletonM03D12di35_XyzDependency = new Pure.DI.UsageTests.Basics.TagsScenario.XyzDependency(); + _rootM03D12di._singletonM03D12di35_XyzDependency = _singletonM03D12di35_XyzDependency; } } } - return new Pure.DI.UsageTests.Basics.TagsScenario.Service(new Pure.DI.UsageTests.Basics.TagsScenario.AbcDependency(), _rootM03D11di._singletonM03D11di35_XyzDependency, new Pure.DI.UsageTests.Basics.TagsScenario.AbcDependency()); + return new Pure.DI.UsageTests.Basics.TagsScenario.Service(new Pure.DI.UsageTests.Basics.TagsScenario.AbcDependency(), _rootM03D12di._singletonM03D12di35_XyzDependency, new Pure.DI.UsageTests.Basics.TagsScenario.AbcDependency()); } } #endregion @@ -220,7 +221,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -234,7 +235,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -247,10 +248,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -271,10 +272,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -326,29 +327,29 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - var valResolverM03D11di_0001 = new ResolverM03D11di_0001(); - ResolverM03D11di.Value = valResolverM03D11di_0001; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + var valResolverM03D12di_0001 = new ResolverM03D12di_0001(); + ResolverM03D12di.Value = valResolverM03D12di_0001; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagsScenario.IDependency), valResolverM03D11di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagsScenario.IService), valResolverM03D11di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagsScenario.IDependency), valResolverM03D12di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagsScenario.IService), valResolverM03D12di_0001) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -361,7 +362,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.TagsScenario.IDependency Resolve(Composition composition) { @@ -379,7 +380,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.TagsScenario.IService Resolve(Composition composition) { diff --git a/readme/task.md b/readme/task.md index 5363b1609..bbb6426e1 100644 --- a/readme/task.md +++ b/readme/task.md @@ -114,9 +114,10 @@ classDiagram /// /// /// -/// GetRoot +/// GetRoot /// /// +/// Provides a composition root of type . /// /// /// @@ -135,16 +136,16 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; - private readonly object _lockM03D11di; + private readonly Composition _rootM03D12di; + private readonly object _lockM03D12di; /// /// This parameterized constructor creates a new instance of with arguments. /// public Composition() { - _rootM03D11di = this; - _lockM03D11di = new object(); + _rootM03D12di = this; + _lockM03D12di = new object(); } /// @@ -153,8 +154,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; - _lockM03D11di = _rootM03D11di._lockM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; + _lockM03D12di = _rootM03D12di._lockM03D12di; } #region Composition Roots @@ -163,32 +164,32 @@ partial class Composition #endif public Pure.DI.UsageTests.BCL.TaskScenario.IService GetRoot(System.Threading.CancellationToken cancellationToken) { - var perResolveM03D11di39_Func = default(System.Func); - System.Threading.Tasks.TaskScheduler transientM03D11di5_TaskScheduler = TaskScheduler.Current; - System.Threading.Tasks.TaskContinuationOptions transientM03D11di4_TaskContinuationOptions = global::System.Threading.Tasks.TaskContinuationOptions.None; - System.Threading.Tasks.TaskCreationOptions transientM03D11di3_TaskCreationOptions = global::System.Threading.Tasks.TaskCreationOptions.None; - System.Threading.Tasks.TaskFactory perBlockM03D11di2_TaskFactory; + var perResolveM03D12di39_Func = default(System.Func); + System.Threading.Tasks.TaskScheduler transientM03D12di5_TaskScheduler = TaskScheduler.Current; + System.Threading.Tasks.TaskContinuationOptions transientM03D12di4_TaskContinuationOptions = global::System.Threading.Tasks.TaskContinuationOptions.None; + System.Threading.Tasks.TaskCreationOptions transientM03D12di3_TaskCreationOptions = global::System.Threading.Tasks.TaskCreationOptions.None; + System.Threading.Tasks.TaskFactory perBlockM03D12di2_TaskFactory; { - var cancellationToken_M03D11di1 = cancellationToken; - var taskCreationOptions_M03D11di2 = transientM03D11di3_TaskCreationOptions; - var taskContinuationOptions_M03D11di3 = transientM03D11di4_TaskContinuationOptions; - var taskScheduler_M03D11di4 = transientM03D11di5_TaskScheduler; - perBlockM03D11di2_TaskFactory = new global::System.Threading.Tasks.TaskFactory(cancellationToken_M03D11di1, taskCreationOptions_M03D11di2, taskContinuationOptions_M03D11di3, taskScheduler_M03D11di4); + var cancellationToken_M03D12di1 = cancellationToken; + var taskCreationOptions_M03D12di2 = transientM03D12di3_TaskCreationOptions; + var taskContinuationOptions_M03D12di3 = transientM03D12di4_TaskContinuationOptions; + var taskScheduler_M03D12di4 = transientM03D12di5_TaskScheduler; + perBlockM03D12di2_TaskFactory = new global::System.Threading.Tasks.TaskFactory(cancellationToken_M03D12di1, taskCreationOptions_M03D12di2, taskContinuationOptions_M03D12di3, taskScheduler_M03D12di4); } - perResolveM03D11di39_Func = new global::System.Func( + perResolveM03D12di39_Func = new global::System.Func( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - var factory_M03D11di5 = new Pure.DI.UsageTests.BCL.TaskScenario.Dependency(); - return factory_M03D11di5; + var factory_M03D12di5 = new Pure.DI.UsageTests.BCL.TaskScenario.Dependency(); + return factory_M03D12di5; }); - System.Threading.Tasks.Task transientM03D11di1_Task; + System.Threading.Tasks.Task transientM03D12di1_Task; { - var factory_M03D11di6 = perResolveM03D11di39_Func; - var taskFactory_M03D11di7 = perBlockM03D11di2_TaskFactory; - transientM03D11di1_Task = taskFactory_M03D11di7.StartNew(factory_M03D11di6); + var factory_M03D12di6 = perResolveM03D12di39_Func; + var taskFactory_M03D12di7 = perBlockM03D12di2_TaskFactory; + transientM03D12di1_Task = taskFactory_M03D12di7.StartNew(factory_M03D12di6); } - return new Pure.DI.UsageTests.BCL.TaskScenario.Service(transientM03D11di1_Task); + return new Pure.DI.UsageTests.BCL.TaskScenario.Service(transientM03D12di1_Task); } #endregion diff --git a/readme/threadsafe-hint.md b/readme/threadsafe-hint.md index ef78edd4f..5b053bac6 100644 --- a/readme/threadsafe-hint.md +++ b/readme/threadsafe-hint.md @@ -72,9 +72,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -93,14 +94,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -109,7 +110,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -136,7 +137,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -150,7 +151,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -163,10 +164,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -187,10 +188,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -233,26 +234,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.ThreadSafeHintScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.ThreadSafeHintScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -265,7 +266,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Hints.ThreadSafeHintScenario.IService Resolve(Composition composition) { diff --git a/readme/tostring-hint.md b/readme/tostring-hint.md index 98ead0af2..6b98be9d3 100644 --- a/readme/tostring-hint.md +++ b/readme/tostring-hint.md @@ -70,9 +70,10 @@ classDiagram /// /// /// -/// MyService +/// MyService /// /// +/// Provides a composition root of type . /// /// /// @@ -91,14 +92,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -107,7 +108,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -134,7 +135,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -148,7 +149,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -161,10 +162,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -185,10 +186,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -231,26 +232,26 @@ partial class Composition " Composition ..> Service : IService MyService"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.ToStringHintScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.ToStringHintScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -263,7 +264,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Hints.ToStringHintScenario.IService Resolve(Composition composition) { diff --git a/readme/tracking-disposable-instances.md b/readme/tracking-disposable-instances.md index 363d095be..32426908a 100644 --- a/readme/tracking-disposable-instances.md +++ b/readme/tracking-disposable-instances.md @@ -125,9 +125,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -146,14 +147,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -162,7 +163,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -173,11 +174,11 @@ partial class Composition #endif get { - var transientM03D11di1_Dependency = new Pure.DI.UsageTests.Basics.TrackingDisposableInstancesScenario.Dependency(); - OnNewInstance(ref transientM03D11di1_Dependency, null, Pure.DI.Lifetime.Transient); - var transientM03D11di0_Service = new Pure.DI.UsageTests.Basics.TrackingDisposableInstancesScenario.Service(transientM03D11di1_Dependency); - OnNewInstance(ref transientM03D11di0_Service, null, Pure.DI.Lifetime.Transient); - return transientM03D11di0_Service; + var transientM03D12di1_Dependency = new Pure.DI.UsageTests.Basics.TrackingDisposableInstancesScenario.Dependency(); + OnNewInstance(ref transientM03D12di1_Dependency, null, Pure.DI.Lifetime.Transient); + var transientM03D12di0_Service = new Pure.DI.UsageTests.Basics.TrackingDisposableInstancesScenario.Service(transientM03D12di1_Dependency); + OnNewInstance(ref transientM03D12di0_Service, null, Pure.DI.Lifetime.Transient); + return transientM03D12di0_Service; } } #endregion @@ -193,7 +194,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -207,7 +208,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -220,10 +221,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -244,10 +245,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -292,26 +293,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TrackingDisposableInstancesScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TrackingDisposableInstancesScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -324,7 +325,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.TrackingDisposableInstancesScenario.IService Resolve(Composition composition) { diff --git a/readme/transient.md b/readme/transient.md index 8f0f01d2e..9701f6811 100644 --- a/readme/transient.md +++ b/readme/transient.md @@ -83,9 +83,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -104,14 +105,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -120,7 +121,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -147,7 +148,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -161,7 +162,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -174,10 +175,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -198,10 +199,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -245,26 +246,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.TransientScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.TransientScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -277,7 +278,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Lifetimes.TransientScenario.IService Resolve(Composition composition) { diff --git a/readme/tuple.md b/readme/tuple.md index bf56de4d2..790bc629b 100644 --- a/readme/tuple.md +++ b/readme/tuple.md @@ -81,9 +81,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -102,14 +103,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -118,7 +119,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -129,8 +130,8 @@ partial class Composition #endif get { - Pure.DI.UsageTests.BCL.TupleScenario.Point transientM03D11di2_Point = new Point(7, 9); - return new Pure.DI.UsageTests.BCL.TupleScenario.Service((transientM03D11di2_Point, new Pure.DI.UsageTests.BCL.TupleScenario.Dependency())); + Pure.DI.UsageTests.BCL.TupleScenario.Point transientM03D12di2_Point = new Point(7, 9); + return new Pure.DI.UsageTests.BCL.TupleScenario.Service((transientM03D12di2_Point, new Pure.DI.UsageTests.BCL.TupleScenario.Dependency())); } } #endregion @@ -146,7 +147,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -160,7 +161,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -173,10 +174,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -197,10 +198,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -249,26 +250,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.TupleScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.TupleScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -281,7 +282,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.TupleScenario.IService Resolve(Composition composition) { diff --git a/readme/type-attribute.md b/readme/type-attribute.md index 67eb62cb5..a1cf2f5a4 100644 --- a/readme/type-attribute.md +++ b/readme/type-attribute.md @@ -84,9 +84,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -105,14 +106,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -121,7 +122,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -148,7 +149,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -162,7 +163,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -175,10 +176,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -199,10 +200,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -245,26 +246,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.TypeAttributeScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.TypeAttributeScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -277,7 +278,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Attributes.TypeAttributeScenario.IService Resolve(Composition composition) { diff --git a/readme/valuetask.md b/readme/valuetask.md index 14f6734cc..644d9d217 100644 --- a/readme/valuetask.md +++ b/readme/valuetask.md @@ -83,9 +83,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -104,14 +105,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -120,7 +121,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -131,12 +132,12 @@ partial class Composition #endif get { - System.Threading.Tasks.ValueTask transientM03D11di1_ValueTask; + System.Threading.Tasks.ValueTask transientM03D12di1_ValueTask; { - var value_M03D11di1 = new Pure.DI.UsageTests.BCL.ValueTaskScenario.Dependency(); - transientM03D11di1_ValueTask = new global::System.Threading.Tasks.ValueTask(value_M03D11di1); + var value_M03D12di1 = new Pure.DI.UsageTests.BCL.ValueTaskScenario.Dependency(); + transientM03D12di1_ValueTask = new global::System.Threading.Tasks.ValueTask(value_M03D12di1); } - return new Pure.DI.UsageTests.BCL.ValueTaskScenario.Service(transientM03D11di1_ValueTask); + return new Pure.DI.UsageTests.BCL.ValueTaskScenario.Service(transientM03D12di1_ValueTask); } } #endregion @@ -152,7 +153,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -166,7 +167,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -179,10 +180,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -203,10 +204,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -251,26 +252,26 @@ partial class Composition " ValueTaskᐸIDependencyᐳ *-- Dependency : IDependency"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ValueTaskScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ValueTaskScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -283,7 +284,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.ValueTaskScenario.IService Resolve(Composition composition) { diff --git a/readme/weak-reference.md b/readme/weak-reference.md index 3c5715dcb..1d3a3dbed 100644 --- a/readme/weak-reference.md +++ b/readme/weak-reference.md @@ -74,9 +74,10 @@ classDiagram /// /// /// -/// Root +/// Root /// /// +/// Provides a composition root of type . /// /// /// @@ -95,14 +96,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D11di; + private readonly Composition _rootM03D12di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D11di = this; + _rootM03D12di = this; } /// @@ -111,7 +112,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D11di = baseComposition._rootM03D11di; + _rootM03D12di = baseComposition._rootM03D12di; } #region Composition Roots @@ -138,7 +139,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D11di.Value.Resolve(this); + return ResolverM03D12di.Value.Resolve(this); } /// @@ -152,7 +153,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D11di.Value.ResolveByTag(this, tag); + return ResolverM03D12di.Value.ResolveByTag(this, tag); } /// @@ -165,10 +166,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -189,10 +190,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D11di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D11di; + var index = (int)(_bucketSizeM03D12di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D12di; do { - ref var pair = ref _bucketsM03D11di[index]; + ref var pair = ref _bucketsM03D12di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -239,26 +240,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D11di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D11di; + private readonly static int _bucketSizeM03D12di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D12di; static Composition() { - var valResolverM03D11di_0000 = new ResolverM03D11di_0000(); - ResolverM03D11di.Value = valResolverM03D11di_0000; - _bucketsM03D11di = global::Pure.DI.Buckets>.Create( + var valResolverM03D12di_0000 = new ResolverM03D12di_0000(); + ResolverM03D12di.Value = valResolverM03D12di_0000; + _bucketsM03D12di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D11di, + out _bucketSizeM03D12di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.WeakReferenceScenario.IService), valResolverM03D11di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.WeakReferenceScenario.IService), valResolverM03D12di_0000) }); } #region Resolvers - private sealed class ResolverM03D11di: global::Pure.DI.IResolver + private sealed class ResolverM03D12di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D11di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D12di(); public T Resolve(Composition composite) { @@ -271,7 +272,7 @@ partial class Composition } } - private sealed class ResolverM03D11di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D12di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.WeakReferenceScenario.IService Resolve(Composition composition) { diff --git a/tests/Pure.DI.UsageTests/Basics/GenericCompositionRootsScenario.cs b/tests/Pure.DI.UsageTests/Basics/GenericsCompositionRootsScenario.cs similarity index 96% rename from tests/Pure.DI.UsageTests/Basics/GenericCompositionRootsScenario.cs rename to tests/Pure.DI.UsageTests/Basics/GenericsCompositionRootsScenario.cs index 4183233be..99fa82f1d 100644 --- a/tests/Pure.DI.UsageTests/Basics/GenericCompositionRootsScenario.cs +++ b/tests/Pure.DI.UsageTests/Basics/GenericsCompositionRootsScenario.cs @@ -1,6 +1,6 @@ /* $v=true -$p=1 +$p=4 $d=Generic composition roots $h=A generic composition root is represented by a method. $f=When a generic composition root is used, `Resolve` methods cannot be used to resolve them. @@ -14,7 +14,7 @@ // ReSharper disable UnusedVariable // ReSharper disable UnusedTypeParameter #pragma warning disable CS9113 // Parameter is unread. -namespace Pure.DI.UsageTests.Basics.GenericCompositionRootsScenario; +namespace Pure.DI.UsageTests.Basics.GenericsCompositionRootsScenario; using Shouldly; using Xunit; diff --git a/tests/Pure.DI.UsageTests/Basics/GenericsScenario.cs b/tests/Pure.DI.UsageTests/Basics/GenericsScenario.cs index 0ef79c654..600678f8c 100644 --- a/tests/Pure.DI.UsageTests/Basics/GenericsScenario.cs +++ b/tests/Pure.DI.UsageTests/Basics/GenericsScenario.cs @@ -55,17 +55,12 @@ public void Run() // { DI.Setup(nameof(Composition)) .Bind>().To>() - .Bind().To().Root("Root") - // It is possible to define a generic composition root as well - .Root>("GetMyGenericRoot"); + .Bind().To().Root("Root"); var composition = new Composition(); var service = composition.Root; service.IntDependency.ShouldBeOfType>(); service.StringDependency.ShouldBeOfType>(); - - // Get a generic composition root - var dependencyInt = composition.GetMyGenericRoot(); // } composition.SaveClassDiagram(); }