From 22a1a28379e646f18f627cb1eb6cbaa8c34c8ac7 Mon Sep 17 00:00:00 2001 From: Nikolay Pianikov Date: Thu, 7 Mar 2024 13:31:33 +0300 Subject: [PATCH] Update readme --- README.md | 11 +- readme/ArrayDetails.md | 42 +++---- readme/Avalonia.md | 15 +-- readme/BlazorServerApp.md | 30 +++-- readme/BlazorWebAssemblyApp.md | 27 ++--- readme/Console.md | 8 +- readme/ConsoleTopLevelStatements.md | 8 +- readme/EnumDetails.md | 48 ++++---- readme/FuncDetails.md | 50 ++++---- readme/GrpcService.md | 5 +- readme/Maui.md | 16 ++- readme/MinimalWebAPI.md | 11 +- readme/SingletonDetails.md | 56 ++++----- readme/TransientDetails.md | 42 +++---- readme/WebAPI.md | 9 +- readme/WebApp.md | 9 +- readme/WinFormsApp.md | 14 +-- readme/WinFormsAppNetCore.md | 15 +-- readme/Wpf.md | 14 +-- readme/a-few-partial-classes.md | 42 +++---- readme/advanced-interception.md | 42 +++---- readme/arguments.md | 56 ++++----- readme/array.md | 42 +++---- readme/async-enumerable.md | 48 ++++---- readme/auto-bindings.md | 6 +- readme/auto-scoped.md | 88 +++++++------- readme/check-for-a-root.md | 68 +++++------ readme/complex-generics.md | 44 +++---- readme/composition-root-kinds.md | 50 ++++---- readme/composition-roots.md | 66 +++++------ readme/constructor-ordinal-attribute.md | 50 ++++---- readme/custom-attributes.md | 56 ++++----- readme/decorator.md | 42 +++---- readme/default-lifetime.md | 70 +++++------ readme/default-values.md | 42 +++---- readme/dependent-compositions.md | 92 +++++++-------- readme/disposable-singleton.md | 78 ++++++------ readme/enumerable-generics.md | 66 +++++------ readme/enumerable.md | 48 ++++---- readme/factory.md | 52 ++++---- readme/field-injection.md | 48 ++++---- readme/func-with-arguments.md | 70 +++++------ readme/func.md | 58 ++++----- readme/generics.md | 42 +++---- readme/injection.md | 50 ++++---- readme/injections-of-abstractions.md | 6 +- readme/instance-initialization.md | 58 ++++----- readme/interception.md | 42 +++---- readme/keyed-service-provider.md | 108 ++++++++--------- readme/lazy.md | 64 +++++----- readme/manually-started-tasks.md | 30 ++--- readme/member-ordinal-attribute.md | 70 +++++------ readme/method-injection.md | 48 ++++---- readme/multi-contract-bindings.md | 42 +++---- readme/oncannotresolve-hint.md | 46 ++++---- readme/ondependencyinjection-hint.md | 42 +++---- readme/onnewinstance-hint.md | 72 ++++++------ readme/overriding-the-bcl-binding.md | 46 ++++---- readme/partial-class.md | 150 +++++++++++++++--------- readme/perblock.md | 92 +++++++-------- readme/perresolve.md | 106 ++++++++--------- readme/property-injection.md | 48 ++++---- readme/required-properties-or-fields.md | 50 ++++---- readme/resolve-hint.md | 6 +- readme/resolve-methods.md | 66 +++++------ readme/root-arguments.md | 6 +- readme/scope.md | 98 ++++++++-------- readme/service-collection.md | 114 +++++++++--------- readme/service-provider-with-scope.md | 140 +++++++++++----------- readme/service-provider.md | 112 +++++++++--------- readme/singleton.md | 62 +++++----- readme/span-and-readonlyspan.md | 46 ++++---- readme/tag-attribute.md | 42 +++---- readme/tags.md | 82 ++++++------- readme/task.md | 48 ++++---- readme/threadsafe-hint.md | 42 +++---- readme/tostring-hint.md | 42 +++---- readme/tracking-disposable-instances.md | 74 ++++++------ readme/transient.md | 42 +++---- readme/tuple.md | 46 ++++---- readme/type-attribute.md | 42 +++---- readme/valuetask.md | 50 ++++---- readme/weak-reference.md | 42 +++---- 83 files changed, 2094 insertions(+), 2074 deletions(-) diff --git a/README.md b/README.md index 584a5fae..b031b44c 100644 --- a/README.md +++ b/README.md @@ -95,16 +95,16 @@ partial class Composition private static void Setup() => DI.Setup(nameof(Composition)) // Models a random subatomic event that may or may not occur - .Bind().As(Singleton).To() + .Bind().As(Singleton).To() // Represents a quantum superposition of 2 states: Alive or Dead - .Bind().To(ctx => + .Bind().To(ctx => { ctx.Inject(out var random); return (State)random.Next(2); }) - .Bind().To() + .Bind().To() // Represents a cardboard box with any contents - .Bind>().To>() + .Bind().To>() // Composition Root .Root("Root"); } @@ -199,6 +199,7 @@ dotnet run ### Basics - [Auto-bindings](readme/auto-bindings.md) - [Injections of abstractions](readme/injections-of-abstractions.md) +- [Abstractions binding](readme/abstractions-binding.md) - [Composition roots](readme/composition-roots.md) - [Resolve methods](readme/resolve-methods.md) - [Factory](readme/factory.md) @@ -207,6 +208,8 @@ dotnet run - [Arguments](readme/arguments.md) - [Root arguments](readme/root-arguments.md) - [Composition root kinds](readme/composition-root-kinds.md) +- [Tag Type](readme/tag-type.md) +- [Tag Unique](readme/tag-unique.md) - [Tags](readme/tags.md) - [Multi-contract bindings](readme/multi-contract-bindings.md) - [Field injection](readme/field-injection.md) diff --git a/readme/ArrayDetails.md b/readme/ArrayDetails.md index 6b7c1696..27f32d80 100644 --- a/readme/ArrayDetails.md +++ b/readme/ArrayDetails.md @@ -116,14 +116,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Array { - private readonly Array _rootM03D01di; + private readonly Array _rootM03D07di; /// /// This constructor creates a new instance of . /// public Array() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -132,7 +132,7 @@ partial class Array /// Base composition. internal Array(Array baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -156,7 +156,7 @@ partial class Array #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -170,7 +170,7 @@ partial class Array #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -183,10 +183,10 @@ partial class Array #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -207,10 +207,10 @@ partial class Array #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -303,26 +303,26 @@ partial class Array " Array ..> CompositionRoot : CompositionRoot PureDIByCR"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Array() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Array composite) { @@ -335,7 +335,7 @@ partial class Array } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { public Pure.DI.Benchmarks.Model.CompositionRoot Resolve(Array composition) { diff --git a/readme/Avalonia.md b/readme/Avalonia.md index 5f226c37..809c729c 100644 --- a/readme/Avalonia.md +++ b/readme/Avalonia.md @@ -10,21 +10,22 @@ The definition of the composition is in [Composition.cs](/samples/AvaloniaApp/Co internal partial class Composition { private static void Setup() => DI.Setup(nameof(Composition)) - // Root + // Provides the composition root for main window .Root("MainWindow") + // Provides the composition root for Clock view model .Root("ClockViewModel") // View Models - .Bind().As(Singleton).To() + .Bind().As(Singleton).To() // Models - .Bind>().To>() - .Bind().To(_ => TimeSpan.FromSeconds(1)) - .Bind().As(Singleton).To() - .Bind().As(PerBlock).To() + .Bind().To>() + .Bind().To(_ => TimeSpan.FromSeconds(1)) + .Bind().As(Singleton).To() + .Bind().As(PerBlock).To() // Infrastructure - .Bind().To(); + .Bind().To(); } ``` diff --git a/readme/BlazorServerApp.md b/readme/BlazorServerApp.md index 9cce9bdc..7ea4b2bf 100644 --- a/readme/BlazorServerApp.md +++ b/readme/BlazorServerApp.md @@ -17,32 +17,30 @@ internal partial class Composition: ServiceProviderFactory // since ServiceProvider will be used to retrieve them. .Hint( Hint.OnCannotResolveContractTypeNameRegularExpression, - "^Microsoft\\.(Extensions|AspNetCore)\\..+$") + @"^Microsoft\.(Extensions|AspNetCore)\..+$") // View Models - .Bind() - .To() + .Bind().To() + // Provides the composition root for Clock view model .Root("ClockViewModel") - .Bind() - .To() + .Bind().To() + // Provides the composition root for Error view model .Root() // Services - .Bind>().To>() - .Bind().To(_ => TimeSpan.FromSeconds(1)) - .Bind().As(Singleton).To() - .Bind().As(PerBlock).To() - .Bind() - .As(Singleton) - .To() + .Bind().To>() + .Bind().To(_ => TimeSpan.FromSeconds(1)) + .Bind().As(Singleton).To() + .Bind().As(PerBlock).To() + .Bind().As(Singleton).To() + // Provides the composition root for Weather Forecast service .Root() - .Bind() - .As(Singleton) - .To() + .Bind().As(Singleton).To() + // Provides the composition root for Counter service .Root() // Infrastructure - .Bind().To(); + .Bind().To(); } ``` diff --git a/readme/BlazorWebAssemblyApp.md b/readme/BlazorWebAssemblyApp.md index 1d840c11..40362915 100644 --- a/readme/BlazorWebAssemblyApp.md +++ b/readme/BlazorWebAssemblyApp.md @@ -17,30 +17,27 @@ internal partial class Composition: ServiceProviderFactory // since ServiceProvider will be used to retrieve them. .Hint( Hint.OnCannotResolveContractTypeNameRegularExpression, - "^Microsoft\\.(Extensions|AspNetCore)\\..+$") + @"^Microsoft\.(Extensions|AspNetCore)\..+$") // View Models - .Bind() - .As(Singleton) - .To() + .Bind().As(Singleton).To() + // Provides the composition root for Clock view model .Root("ClockViewModel") // Services - .Bind>().To>() - .Bind().To(_ => TimeSpan.FromSeconds(1)) - .Bind().As(Singleton).To() - .Bind().As(PerBlock).To() - .Bind() - .As(Singleton) - .To() + .Bind().To>() + .Bind().To(_ => TimeSpan.FromSeconds(1)) + .Bind().As(Singleton).To() + .Bind().As(PerBlock).To() + .Bind().As(Singleton).To() + // Provides the composition root for Weather Forecast service .Root() - .Bind() - .As(Singleton) - .To() + .Bind().As(Singleton).To() + // Provides the composition root for Counter service .Root() // Infrastructure - .Bind().To(); + .Bind().To(); } ``` diff --git a/readme/Console.md b/readme/Console.md index a4768156..c6f85a0d 100644 --- a/readme/Console.md +++ b/readme/Console.md @@ -52,17 +52,17 @@ internal partial class Composition private static void Setup() => DI.Setup(nameof(Composition)) // Models a random subatomic event that may or may not occur - .Bind().As(Singleton).To() + .Bind().As(Singleton).To() // Represents a quantum superposition of 2 states: Alive or Dead - .Bind().To(ctx => + .Bind().To(ctx => { ctx.Inject(out var random); return (State)random.Next(2); }) // Represents schrodinger's cat - .Bind().To() + .Bind().To() // Represents a cardboard box with any content - .Bind>().To>() + .Bind().To>() // Composition Root .Root("Root"); } diff --git a/readme/ConsoleTopLevelStatements.md b/readme/ConsoleTopLevelStatements.md index d3fbdb6d..9335c236 100644 --- a/readme/ConsoleTopLevelStatements.md +++ b/readme/ConsoleTopLevelStatements.md @@ -15,17 +15,17 @@ new Composition().Root.Run(); // and can be in any part of the compiled code because this is just a hint to set up an object graph. DI.Setup("Composition") // Models a random subatomic event that may or may not occur - .Bind().As(Singleton).To() + .Bind().As(Singleton).To() // Represents a quantum superposition of 2 states: Alive or Dead - .Bind().To(ctx => + .Bind().To(ctx => { ctx.Inject(out var random); return (State)random.Next(2); }) // Represents schrodinger's cat - .Bind().To() + .Bind().To() // Represents a cardboard box with any content - .Bind>().To>() + .Bind().To>() // Composition Root .Root("Root"); diff --git a/readme/EnumDetails.md b/readme/EnumDetails.md index 35e5dc34..414c2a3e 100644 --- a/readme/EnumDetails.md +++ b/readme/EnumDetails.md @@ -116,14 +116,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Enum { - private readonly Enum _rootM03D01di; + private readonly Enum _rootM03D07di; /// /// This constructor creates a new instance of . /// public Enum() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -132,7 +132,7 @@ partial class Enum /// Base composition. internal Enum(Enum baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -142,15 +142,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 LocalperBlockM03D01di10_IEnumerable() + System.Collections.Generic.IEnumerable LocalperBlockM03D07di10_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 perBlockM03D01di10_IEnumerable = LocalperBlockM03D01di10_IEnumerable(); - return new Pure.DI.Benchmarks.Model.CompositionRoot(new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D01di10_IEnumerable)), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D01di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D01di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D01di10_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 perBlockM03D07di10_IEnumerable = LocalperBlockM03D07di10_IEnumerable(); + return new Pure.DI.Benchmarks.Model.CompositionRoot(new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D07di10_IEnumerable)), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D07di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D07di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D07di10_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 +165,7 @@ partial class Enum #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -179,7 +179,7 @@ partial class Enum #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -192,10 +192,10 @@ partial class Enum #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -216,10 +216,10 @@ partial class Enum #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -312,26 +312,26 @@ partial class Enum " Enum ..> CompositionRoot : CompositionRoot PureDIByCR"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Enum() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Enum composite) { @@ -344,7 +344,7 @@ partial class Enum } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 04eed7e6..cc39312e 100644 --- a/readme/FuncDetails.md +++ b/readme/FuncDetails.md @@ -95,14 +95,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Func { - private readonly Func _rootM03D01di; + private readonly Func _rootM03D07di; /// /// This constructor creates a new instance of . /// public Func() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -111,7 +111,7 @@ partial class Func /// Base composition. internal Func(Func baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -120,14 +120,14 @@ partial class Func #endif public partial Pure.DI.Benchmarks.Model.CompositionRoot PureDIByCR() { - System.Func perBlockM03D01di10_Func = new Func( + System.Func perBlockM03D07di10_Func = new Func( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - var value_M03D01di1 = new Pure.DI.Benchmarks.Model.Service3(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()); - return value_M03D01di1; + var value_M03D07di1 = new Pure.DI.Benchmarks.Model.Service3(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4()); + return value_M03D07di1; }); - return new Pure.DI.Benchmarks.Model.CompositionRoot(new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D01di10_Func)), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D01di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D01di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D01di10_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(perBlockM03D07di10_Func)), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D07di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D07di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D07di10_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 +142,7 @@ partial class Func #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -156,7 +156,7 @@ partial class Func #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -169,10 +169,10 @@ partial class Func #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -193,10 +193,10 @@ partial class Func #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -268,26 +268,26 @@ partial class Func " FuncᐸIService3ᐳ *-- Service3 : IService3"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Func() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Func composite) { @@ -300,7 +300,7 @@ partial class Func } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { public Pure.DI.Benchmarks.Model.CompositionRoot Resolve(Func composition) { diff --git a/readme/GrpcService.md b/readme/GrpcService.md index bae79687..832c9222 100644 --- a/readme/GrpcService.md +++ b/readme/GrpcService.md @@ -17,8 +17,9 @@ internal partial class Composition: ServiceProviderFactory // since ServiceProvider will be used to retrieve them. .Hint( Hint.OnCannotResolveContractTypeNameRegularExpression, - "^Microsoft\\.(Extensions|AspNetCore)\\..+$") - + @"^Microsoft\.(Extensions|AspNetCore)\..+$") + + // Provides the composition root for Greeter service .Root(); } ``` diff --git a/readme/Maui.md b/readme/Maui.md index 3979639a..90b44620 100644 --- a/readme/Maui.md +++ b/readme/Maui.md @@ -14,25 +14,23 @@ internal partial class Composition: ServiceProviderFactory // Specifies not to attempt to resolve types whose fully qualified name // begins with Microsoft.Extensions., Microsoft.Maui. // since ServiceProvider will be used to retrieve them. - .Hint( - Hint.OnCannotResolveContractTypeNameRegularExpression, - "^Microsoft\\.(Extensions|Maui)\\..+$") + .Hint(Hint.OnCannotResolveContractTypeNameRegularExpression, "^Microsoft\\.(Extensions|Maui)\\..+$") // Roots .Root("AppShell") .Root("ClockViewModel") // View Models - .Bind().As(Singleton).To() + .Bind().As(Singleton).To() // Models - .Bind>().To>() - .Bind().To(_ => TimeSpan.FromSeconds(1)) - .Bind().As(Singleton).To() - .Bind().As(PerBlock).To() + .Bind().To>() + .Bind().To(_ => TimeSpan.FromSeconds(1)) + .Bind().As(Singleton).To() + .Bind().As(PerBlock).To() // Infrastructure - .Bind().To(); + .Bind().To(); } ``` diff --git a/readme/MinimalWebAPI.md b/readme/MinimalWebAPI.md index 9865af8b..896bb2ea 100644 --- a/readme/MinimalWebAPI.md +++ b/readme/MinimalWebAPI.md @@ -17,12 +17,11 @@ internal partial class Composition: ServiceProviderFactory // since ServiceProvider will be used to retrieve them. .Hint( Hint.OnCannotResolveContractTypeNameRegularExpression, - "^Microsoft\\.(Extensions|AspNetCore)\\..+$") - - .Bind() - .As(Singleton) - .To() - + @"^Microsoft\.(Extensions|AspNetCore)\..+$") + + .Bind().As(Singleton).To() + .Root() + // Application composition root .Root("Root"); } diff --git a/readme/SingletonDetails.md b/readme/SingletonDetails.md index 5937038a..b6315556 100644 --- a/readme/SingletonDetails.md +++ b/readme/SingletonDetails.md @@ -97,16 +97,16 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Singleton { - private readonly Singleton _rootM03D01di; - private Pure.DI.Benchmarks.Model.Service1 _scopedM03D01di35_Service1; - private Pure.DI.Benchmarks.Model.Service4 _scopedM03D01di38_Service4; + private readonly Singleton _rootM03D07di; + private Pure.DI.Benchmarks.Model.Service1 _scopedM03D07di35_Service1; + private Pure.DI.Benchmarks.Model.Service4 _scopedM03D07di38_Service4; /// /// This constructor creates a new instance of . /// public Singleton() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -115,7 +115,7 @@ partial class Singleton /// Base composition. internal Singleton(Singleton baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -124,15 +124,15 @@ partial class Singleton #endif public partial Pure.DI.Benchmarks.Model.CompositionRoot PureDIByCR() { - if (ReferenceEquals(_scopedM03D01di38_Service4, null)) + if (ReferenceEquals(_scopedM03D07di38_Service4, null)) { - _scopedM03D01di38_Service4 = new Pure.DI.Benchmarks.Model.Service4(); + _scopedM03D07di38_Service4 = new Pure.DI.Benchmarks.Model.Service4(); } - if (ReferenceEquals(_scopedM03D01di35_Service1, null)) + if (ReferenceEquals(_scopedM03D07di35_Service1, null)) { - _scopedM03D01di35_Service1 = new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4))); + _scopedM03D07di35_Service1 = new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4))); } - return new Pure.DI.Benchmarks.Model.CompositionRoot(_scopedM03D01di35_Service1, new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4)), new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4)), new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4)), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D01di38_Service4, _scopedM03D01di38_Service4), _scopedM03D01di38_Service4, _scopedM03D01di38_Service4); + return new Pure.DI.Benchmarks.Model.CompositionRoot(_scopedM03D07di35_Service1, new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4)), new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4)), new Pure.DI.Benchmarks.Model.Service2(new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4)), new Pure.DI.Benchmarks.Model.Service3(_scopedM03D07di38_Service4, _scopedM03D07di38_Service4), _scopedM03D07di38_Service4, _scopedM03D07di38_Service4); } #endregion @@ -147,7 +147,7 @@ partial class Singleton #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -161,7 +161,7 @@ partial class Singleton #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -174,10 +174,10 @@ partial class Singleton #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -198,10 +198,10 @@ partial class Singleton #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -275,26 +275,26 @@ partial class Singleton " Singleton ..> CompositionRoot : CompositionRoot PureDIByCR"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Singleton() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Singleton composite) { @@ -307,7 +307,7 @@ partial class Singleton } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 f6ccfe7e..d4c732be 100644 --- a/readme/TransientDetails.md +++ b/readme/TransientDetails.md @@ -97,14 +97,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Transient { - private readonly Transient _rootM03D01di; + private readonly Transient _rootM03D07di; /// /// This constructor creates a new instance of . /// public Transient() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -113,7 +113,7 @@ partial class Transient /// Base composition. internal Transient(Transient baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -137,7 +137,7 @@ partial class Transient #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -151,7 +151,7 @@ partial class Transient #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -164,10 +164,10 @@ partial class Transient #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -188,10 +188,10 @@ partial class Transient #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -265,26 +265,26 @@ partial class Transient " Transient ..> CompositionRoot : CompositionRoot PureDIByCR"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Transient() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Transient composite) { @@ -297,7 +297,7 @@ partial class Transient } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { public Pure.DI.Benchmarks.Model.CompositionRoot Resolve(Transient composition) { diff --git a/readme/WebAPI.md b/readme/WebAPI.md index ae0c9135..338fc89b 100644 --- a/readme/WebAPI.md +++ b/readme/WebAPI.md @@ -17,11 +17,10 @@ internal partial class Composition: ServiceProviderFactory // since ServiceProvider will be used to retrieve them. .Hint( Hint.OnCannotResolveContractTypeNameRegularExpression, - "^Microsoft\\.(Extensions|AspNetCore)\\..+$") - - .Bind() - .As(Singleton) - .To() + @"^Microsoft\.(Extensions|AspNetCore)\..+$") + + .Bind().As(Singleton).To() + // Provides the composition root for Weather Forecast controller .Root(); } ``` diff --git a/readme/WebApp.md b/readme/WebApp.md index c5dec89b..e9f284b0 100644 --- a/readme/WebApp.md +++ b/readme/WebApp.md @@ -17,12 +17,11 @@ internal partial class Composition: ServiceProviderFactory // since ServiceProvider will be used to retrieve them. .Hint( Hint.OnCannotResolveContractTypeNameRegularExpression, - "^Microsoft\\.(Extensions|AspNetCore)\\..+$") + @"^Microsoft\.(Extensions|AspNetCore)\..+$") - .Bind() - .As(Singleton) - .To() - .Root(); + .Bind().As(Singleton).To() + // Provides the composition root for Home controller + .Root(); } ``` diff --git a/readme/WinFormsApp.md b/readme/WinFormsApp.md index e171ea27..3af9c1c1 100644 --- a/readme/WinFormsApp.md +++ b/readme/WinFormsApp.md @@ -13,19 +13,19 @@ internal partial class Composition .Root("FormMain") // Forms - .Bind().As(Singleton).To() + .Bind().As(Singleton).To() // View Models - .Bind().As(Singleton).To() + .Bind().As(Singleton).To() // Models - .Bind>().To>() - .Bind().To(_ => TimeSpan.FromSeconds(1)) - .Bind().As(Singleton).To() - .Bind().As(PerBlock).To() + .Bind().To>() + .Bind().To(_ => TimeSpan.FromSeconds(1)) + .Bind().As(Singleton).To() + .Bind().As(PerBlock).To() // Infrastructure - .Bind().As(Singleton).To(); + .Bind().As(Singleton).To(); } ``` diff --git a/readme/WinFormsAppNetCore.md b/readme/WinFormsAppNetCore.md index 067c5228..dad32b60 100644 --- a/readme/WinFormsAppNetCore.md +++ b/readme/WinFormsAppNetCore.md @@ -10,22 +10,23 @@ The composition definition is in the file [Composition.cs](/samples/WinFormsAppN internal partial class Composition { private static void Setup() => DI.Setup(nameof(Composition)) + // Provides the composition root for main form .Root("FormMain") // Forms - .Bind().As(Singleton).To() + .Bind().As(Singleton).To() // View Models - .Bind().As(Singleton).To() + .Bind().As(Singleton).To() // Models - .Bind>().To>() - .Bind().To(_ => TimeSpan.FromSeconds(1)) - .Bind().As(Singleton).To() - .Bind().As(PerBlock).To() + .Bind().To>() + .Bind().To(_ => TimeSpan.FromSeconds(1)) + .Bind().As(Singleton).To() + .Bind().As(PerBlock).To() // Infrastructure - .Bind().To(); + .Bind().To(); } ``` diff --git a/readme/Wpf.md b/readme/Wpf.md index 2e46d60a..187f67fa 100644 --- a/readme/Wpf.md +++ b/readme/Wpf.md @@ -10,20 +10,20 @@ The definition of the composition is in [Composition.cs](/samples/WpfAppNetCore/ internal partial class Composition { private static void Setup() => DI.Setup(nameof(Composition)) - // Root + // Provides the composition root for clock view model .Root("ClockViewModel") // View Models - .Bind().As(Singleton).To() + .Bind().As(Singleton).To() // Models - .Bind>().To>() - .Bind().To(_ => TimeSpan.FromSeconds(1)) - .Bind().As(Singleton).To() - .Bind().As(PerBlock).To() + .Bind().To>() + .Bind().To(_ => TimeSpan.FromSeconds(1)) + .Bind().As(Singleton).To() + .Bind().As(PerBlock).To() // Infrastructure - .Bind().To(); + .Bind().To(); } ``` diff --git a/readme/a-few-partial-classes.md b/readme/a-few-partial-classes.md index 1bcadc37..8d5749f9 100644 --- a/readme/a-few-partial-classes.md +++ b/readme/a-few-partial-classes.md @@ -107,14 +107,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -123,7 +123,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -150,7 +150,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -164,7 +164,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -177,10 +177,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -201,10 +201,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -247,26 +247,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.SeveralPartialClassesScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.SeveralPartialClassesScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -279,7 +279,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 5e425eaf..31c95ee4 100644 --- a/readme/advanced-interception.md +++ b/readme/advanced-interception.md @@ -175,14 +175,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -191,7 +191,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -218,7 +218,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -232,7 +232,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -245,10 +245,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -269,10 +269,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -317,26 +317,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Interception.AdvancedInterceptionScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Interception.AdvancedInterceptionScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -349,7 +349,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 e759b44d..b89fbe3b 100644 --- a/readme/arguments.md +++ b/readme/arguments.md @@ -120,9 +120,9 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; - private readonly int _argM03D01di_id; - private readonly string _argM03D01di_serviceName; + private readonly Composition _rootM03D07di; + private readonly int _argM03D07di_id; + private readonly string _argM03D07di_serviceName; /// /// This parameterized constructor creates a new instance of with arguments. @@ -136,14 +136,14 @@ partial class Composition /// public Composition(int id, string serviceName) { - _rootM03D01di = this; + _rootM03D07di = this; if (ReferenceEquals(serviceName, null)) { throw new global::System.ArgumentNullException("serviceName"); } - _argM03D01di_id = id; - _argM03D01di_serviceName = serviceName; + _argM03D07di_id = id; + _argM03D07di_serviceName = serviceName; } /// @@ -152,9 +152,9 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _argM03D01di_id = baseComposition._argM03D01di_id; - _argM03D01di_serviceName = baseComposition._argM03D01di_serviceName; + _rootM03D07di = baseComposition._rootM03D07di; + _argM03D07di_id = baseComposition._argM03D07di_id; + _argM03D07di_serviceName = baseComposition._argM03D07di_serviceName; } #region Composition Roots @@ -165,7 +165,7 @@ partial class Composition #endif get { - return new Pure.DI.UsageTests.Basics.ArgumentsScenario.Service(_argM03D01di_serviceName, new Pure.DI.UsageTests.Basics.ArgumentsScenario.Dependency(_argM03D01di_id)); + return new Pure.DI.UsageTests.Basics.ArgumentsScenario.Service(_argM03D07di_serviceName, new Pure.DI.UsageTests.Basics.ArgumentsScenario.Dependency(_argM03D07di_id)); } } #endregion @@ -181,7 +181,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -195,7 +195,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -208,10 +208,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -232,10 +232,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -282,26 +282,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ArgumentsScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ArgumentsScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -314,7 +314,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 1fe770f9..3eac31b3 100644 --- a/readme/array.md +++ b/readme/array.md @@ -132,14 +132,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -148,7 +148,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -175,7 +175,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -189,7 +189,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -202,10 +202,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -226,10 +226,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -279,26 +279,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ArrayScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ArrayScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -311,7 +311,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 7d0a3ba1..187759ef 100644 --- a/readme/async-enumerable.md +++ b/readme/async-enumerable.md @@ -115,14 +115,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -131,7 +131,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -143,13 +143,13 @@ partial class Composition get { [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)0x200)] - async System.Collections.Generic.IAsyncEnumerable LocaltransientM03D01di1_IAsyncEnumerable() + async System.Collections.Generic.IAsyncEnumerable LocaltransientM03D07di1_IAsyncEnumerable() { yield return new Pure.DI.UsageTests.BCL.AsyncEnumerableScenario.AbcDependency(); yield return new Pure.DI.UsageTests.BCL.AsyncEnumerableScenario.XyzDependency(); } - var transientM03D01di1_IAsyncEnumerable = LocaltransientM03D01di1_IAsyncEnumerable(); - return new Pure.DI.UsageTests.BCL.AsyncEnumerableScenario.Service(transientM03D01di1_IAsyncEnumerable); + var transientM03D07di1_IAsyncEnumerable = LocaltransientM03D07di1_IAsyncEnumerable(); + return new Pure.DI.UsageTests.BCL.AsyncEnumerableScenario.Service(transientM03D07di1_IAsyncEnumerable); } } #endregion @@ -165,7 +165,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -179,7 +179,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -192,10 +192,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -216,10 +216,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -269,26 +269,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.AsyncEnumerableScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.AsyncEnumerableScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -301,7 +301,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 59159a8b..321c57b2 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 _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -98,7 +98,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots diff --git a/readme/auto-scoped.md b/readme/auto-scoped.md index d9c496b3..18f90340 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 _rootM03D01di; - private readonly object _lockM03D01di; - private Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Dependency _scopedM03D01di34_Dependency; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; + private Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Dependency _scopedM03D07di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); + _rootM03D07di = this; + _lockM03D07di = new object(); } /// @@ -161,8 +161,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots @@ -176,17 +176,17 @@ partial class Composition #endif get { - if (ReferenceEquals(_scopedM03D01di34_Dependency, null)) + if (ReferenceEquals(_scopedM03D07di34_Dependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_scopedM03D01di34_Dependency, null)) + if (ReferenceEquals(_scopedM03D07di34_Dependency, null)) { - _scopedM03D01di34_Dependency = new Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Dependency(); + _scopedM03D07di34_Dependency = new Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Dependency(); } } } - return new Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Service(_scopedM03D01di34_Dependency); + return new Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Service(_scopedM03D07di34_Dependency); } } @@ -200,23 +200,23 @@ partial class Composition #endif get { - var perResolveM03D01di39_Func = default(System.Func); - perResolveM03D01di39_Func = new global::System.Func( + var perResolveM03D07di39_Func = default(System.Func); + perResolveM03D07di39_Func = new global::System.Func( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - var transientM03D01di2_Composition = this; - Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.IService transientM03D01di1_IService; + var transientM03D07di2_Composition = this; + Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.IService transientM03D07di1_IService; { - var baseComposition_M03D01di2 = transientM03D01di2_Composition; + var baseComposition_M03D07di2 = transientM03D07di2_Composition; // Creates a session - var session_M03D01di3 = new Composition(baseComposition_M03D01di2); - transientM03D01di1_IService = session_M03D01di3.SessionRoot; + var session_M03D07di3 = new Composition(baseComposition_M03D07di2); + transientM03D07di1_IService = session_M03D07di3.SessionRoot; } - var factory_M03D01di1 = transientM03D01di1_IService; - return factory_M03D01di1; + var factory_M03D07di1 = transientM03D07di1_IService; + return factory_M03D07di1; }); - return new Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Program(perResolveM03D01di39_Func); + return new Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Program(perResolveM03D07di39_Func); } } #endregion @@ -232,7 +232,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -246,7 +246,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -259,10 +259,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[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)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[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 _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - var valResolverM03D01di_0001 = new ResolverM03D01di_0001(); - ResolverM03D01di.Value = valResolverM03D01di_0001; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + var valResolverM03D07di_0001 = new ResolverM03D07di_0001(); + ResolverM03D07di.Value = valResolverM03D07di_0001; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Service), valResolverM03D01di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Program), valResolverM03D01di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Service), valResolverM03D07di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.AutoScopedScenario.Program), valResolverM03D07di_0001) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -371,7 +371,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 ResolverM03D01di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 7e80a837..d0d40a1d 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 RootM03D01di0001 + -IDependency RootM03D07di0001 + 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 RootM03D01di0001 + Composition ..> Dependency : "MyDep" IDependency RootM03D07di0001 Composition ..> Service : IService Root ``` @@ -126,21 +126,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 _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -149,7 +149,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -167,7 +167,7 @@ partial class Composition } } - public Pure.DI.UsageTests.Basics.CheckForRootScenario.IDependency RootM03D01di0001 + public Pure.DI.UsageTests.Basics.CheckForRootScenario.IDependency RootM03D07di0001 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] @@ -190,7 +190,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -204,7 +204,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -217,10 +217,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -241,10 +241,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -264,7 +264,7 @@ partial class Composition "classDiagram\n" + " class Composition {\n" + " +IService Root\n" + - " -IDependency RootM03D01di0001\n" + + " -IDependency RootM03D07di0001\n" + " + T ResolveᐸTᐳ()\n" + " + T ResolveᐸTᐳ(object? tag)\n" + " + object Resolve(Type type)\n" + @@ -286,37 +286,37 @@ partial class Composition " <>\n" + " }\n" + " Service *-- Dependency : \"MyDep\" IDependency\n" + - " Composition ..> Dependency : \"MyDep\" IDependency RootM03D01di0001\n" + + " Composition ..> Dependency : \"MyDep\" IDependency RootM03D07di0001\n" + " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; private static partial void OnNewRoot(global::Pure.DI.IResolver resolver, string name, object? tag, global::Pure.DI.Lifetime lifetime); static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - OnNewRoot(valResolverM03D01di_0000, "Root", null, Pure.DI.Lifetime.Transient); - ResolverM03D01di.Value = valResolverM03D01di_0000; - var valResolverM03D01di_0001 = new ResolverM03D01di_0001(); - OnNewRoot(valResolverM03D01di_0001, "RootM03D01di0001", "MyDep", Pure.DI.Lifetime.Transient); - ResolverM03D01di.Value = valResolverM03D01di_0001; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + OnNewRoot(valResolverM03D07di_0000, "Root", null, Pure.DI.Lifetime.Transient); + ResolverM03D07di.Value = valResolverM03D07di_0000; + var valResolverM03D07di_0001 = new ResolverM03D07di_0001(); + OnNewRoot(valResolverM03D07di_0001, "RootM03D07di0001", "MyDep", Pure.DI.Lifetime.Transient); + ResolverM03D07di.Value = valResolverM03D07di_0001; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CheckForRootScenario.IService), valResolverM03D01di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CheckForRootScenario.IDependency), valResolverM03D01di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CheckForRootScenario.IService), valResolverM03D07di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CheckForRootScenario.IDependency), valResolverM03D07di_0001) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -329,7 +329,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.CheckForRootScenario.IService Resolve(Composition composition) { @@ -347,7 +347,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.CheckForRootScenario.IDependency Resolve(Composition composition) { @@ -359,7 +359,7 @@ partial class Composition switch (tag) { case "MyDep": - return composition.RootM03D01di0001; + return composition.RootM03D07di0001; } 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 9f050691..db814cce 100644 --- a/readme/complex-generics.md +++ b/readme/complex-generics.md @@ -115,7 +115,7 @@ classDiagram /// /// /// -/// Root +/// Root /// /// /// @@ -136,14 +136,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -152,7 +152,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -179,7 +179,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -193,7 +193,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -206,10 +206,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -230,10 +230,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -288,26 +288,26 @@ partial class Composition " ServiceᐸStringˏInt32ˏListᐸStringᐳˏDictionaryᐸStringˏInt32ᐳᐳ *-- DependencyStructᐸInt32ᐳ : \"value type\" IDependencyᐸInt32ᐳ"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di>.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di>.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ComplexGenericsScenario.Program), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ComplexGenericsScenario.Program), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -320,7 +320,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver> + private sealed class ResolverM03D07di_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 68b0162b..fac02aff 100644 --- a/readme/composition-root-kinds.md +++ b/readme/composition-root-kinds.md @@ -132,14 +132,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -148,7 +148,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -200,7 +200,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -214,7 +214,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -227,10 +227,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[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)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[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 _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - var valResolverM03D01di_0001 = new ResolverM03D01di_0001(); - ResolverM03D01di.Value = valResolverM03D01di_0001; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + var valResolverM03D07di_0001 = new ResolverM03D07di_0001(); + ResolverM03D07di.Value = valResolverM03D07di_0001; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootKindsScenario.IService), valResolverM03D01di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootKindsScenario.IDependency), valResolverM03D01di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootKindsScenario.IService), valResolverM03D07di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootKindsScenario.IDependency), valResolverM03D07di_0001) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -340,7 +340,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 ResolverM03D01di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 25dffdf0..292869c6 100644 --- a/readme/composition-roots.md +++ b/readme/composition-roots.md @@ -68,7 +68,7 @@ classDiagram class Composition { +IService MyRoot +IService SomeOtherService - -IDependency RootM03D01di0003 + -IDependency RootM03D07di0003 + T ResolveᐸTᐳ() + T ResolveᐸTᐳ(object? tag) + object Resolve(Type type) @@ -95,7 +95,7 @@ classDiagram Service *-- Dependency : IDependency Composition ..> Service : IService MyRoot Composition ..> OtherService : "Other" IService SomeOtherService - Composition ..> Dependency : IDependency RootM03D01di0003 + Composition ..> Dependency : IDependency RootM03D07di0003 ``` @@ -148,21 +148,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 _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -171,7 +171,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -210,7 +210,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 RootM03D01di0003 + public Pure.DI.UsageTests.Basics.CompositionRootsScenario.IDependency RootM03D07di0003 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] @@ -233,7 +233,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -247,7 +247,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -260,10 +260,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -284,10 +284,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -308,7 +308,7 @@ partial class Composition " class Composition {\n" + " +IService MyRoot\n" + " +IService SomeOtherService\n" + - " -IDependency RootM03D01di0003\n" + + " -IDependency RootM03D07di0003\n" + " + T ResolveᐸTᐳ()\n" + " + T ResolveᐸTᐳ(object? tag)\n" + " + object Resolve(Type type)\n" + @@ -335,32 +335,32 @@ partial class Composition " Service *-- Dependency : IDependency\n" + " Composition ..> Service : IService MyRoot\n" + " Composition ..> OtherService : \"Other\" IService SomeOtherService\n" + - " Composition ..> Dependency : IDependency RootM03D01di0003"; + " Composition ..> Dependency : IDependency RootM03D07di0003"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - var valResolverM03D01di_0001 = new ResolverM03D01di_0001(); - ResolverM03D01di.Value = valResolverM03D01di_0001; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + var valResolverM03D07di_0001 = new ResolverM03D07di_0001(); + ResolverM03D07di.Value = valResolverM03D07di_0001; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootsScenario.IService), valResolverM03D01di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootsScenario.IDependency), valResolverM03D01di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootsScenario.IService), valResolverM03D07di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.CompositionRootsScenario.IDependency), valResolverM03D07di_0001) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -373,7 +373,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.CompositionRootsScenario.IService Resolve(Composition composition) { @@ -393,11 +393,11 @@ partial class Composition } } - private sealed class ResolverM03D01di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.CompositionRootsScenario.IDependency Resolve(Composition composition) { - return composition.RootM03D01di0003; + return composition.RootM03D07di0003; } public Pure.DI.UsageTests.Basics.CompositionRootsScenario.IDependency ResolveByTag(Composition composition, object tag) @@ -405,7 +405,7 @@ partial class Composition switch (tag) { case null: - return composition.RootM03D01di0003; + return composition.RootM03D07di0003; } 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 f49e7433..5e2de190 100644 --- a/readme/constructor-ordinal-attribute.md +++ b/readme/constructor-ordinal-attribute.md @@ -99,8 +99,8 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; - private readonly string _argM03D01di_serviceName; + private readonly Composition _rootM03D07di; + private readonly string _argM03D07di_serviceName; /// /// This parameterized constructor creates a new instance of with arguments. @@ -108,13 +108,13 @@ partial class Composition /// The composition argument of type . public Composition(string serviceName) { - _rootM03D01di = this; + _rootM03D07di = this; if (ReferenceEquals(serviceName, null)) { throw new global::System.ArgumentNullException("serviceName"); } - _argM03D01di_serviceName = serviceName; + _argM03D07di_serviceName = serviceName; } /// @@ -123,8 +123,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _argM03D01di_serviceName = baseComposition._argM03D01di_serviceName; + _rootM03D07di = baseComposition._rootM03D07di; + _argM03D07di_serviceName = baseComposition._argM03D07di_serviceName; } #region Composition Roots @@ -135,7 +135,7 @@ partial class Composition #endif get { - return new Pure.DI.UsageTests.Attributes.ConstructorOrdinalAttributeScenario.Service(_argM03D01di_serviceName); + return new Pure.DI.UsageTests.Attributes.ConstructorOrdinalAttributeScenario.Service(_argM03D07di_serviceName); } } #endregion @@ -151,7 +151,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -165,7 +165,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -178,10 +178,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -202,10 +202,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -242,26 +242,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.ConstructorOrdinalAttributeScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.ConstructorOrdinalAttributeScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -274,7 +274,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 ff2b83cb..491fa448 100644 --- a/readme/custom-attributes.md +++ b/readme/custom-attributes.md @@ -115,8 +115,8 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class PersonComposition { - private readonly PersonComposition _rootM03D01di; - private readonly int _argM03D01di_personId; + private readonly PersonComposition _rootM03D07di; + private readonly int _argM03D07di_personId; /// /// This parameterized constructor creates a new instance of with arguments. @@ -124,8 +124,8 @@ partial class PersonComposition /// The composition argument of type . public PersonComposition(int personId) { - _rootM03D01di = this; - _argM03D01di_personId = personId; + _rootM03D07di = this; + _argM03D07di_personId = personId; } /// @@ -134,8 +134,8 @@ partial class PersonComposition /// Base composition. internal PersonComposition(PersonComposition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _argM03D01di_personId = baseComposition._argM03D01di_personId; + _rootM03D07di = baseComposition._rootM03D07di; + _argM03D07di_personId = baseComposition._argM03D07di_personId; } #region Composition Roots @@ -146,10 +146,10 @@ partial class PersonComposition #endif get { - string transientM03D01di1_String = "Nik"; - var transientM03D01di0_Person = new Pure.DI.UsageTests.Attributes.CustomAttributesScenario.Person(transientM03D01di1_String); - transientM03D01di0_Person.Id = _argM03D01di_personId; - return transientM03D01di0_Person; + string transientM03D07di1_String = "Nik"; + var transientM03D07di0_Person = new Pure.DI.UsageTests.Attributes.CustomAttributesScenario.Person(transientM03D07di1_String); + transientM03D07di0_Person.Id = _argM03D07di_personId; + return transientM03D07di0_Person; } } #endregion @@ -165,7 +165,7 @@ partial class PersonComposition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -179,7 +179,7 @@ partial class PersonComposition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -192,10 +192,10 @@ partial class PersonComposition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -216,10 +216,10 @@ partial class PersonComposition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -259,26 +259,26 @@ partial class PersonComposition " PersonComposition ..> Person : IPerson Person"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static PersonComposition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.CustomAttributesScenario.IPerson), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.CustomAttributesScenario.IPerson), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(PersonComposition composite) { @@ -291,7 +291,7 @@ partial class PersonComposition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 b288d62e..0ff446e5 100644 --- a/readme/decorator.md +++ b/readme/decorator.md @@ -92,14 +92,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -108,7 +108,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -135,7 +135,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -149,7 +149,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -162,10 +162,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -186,10 +186,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -229,26 +229,26 @@ partial class Composition " Composition ..> GreetingService : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Interception.DecoratorScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Interception.DecoratorScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -261,7 +261,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 cff0de55..d149062d 100644 --- a/readme/default-lifetime.md +++ b/readme/default-lifetime.md @@ -105,18 +105,18 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; - private readonly object _lockM03D01di; - private Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Service _singletonM03D01di35_Service; - private Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Dependency _singletonM03D01di34_Dependency; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; + private Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Service _singletonM03D07di35_Service; + private Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Dependency _singletonM03D07di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); + _rootM03D07di = this; + _lockM03D07di = new object(); } /// @@ -125,8 +125,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots @@ -137,23 +137,23 @@ partial class Composition #endif get { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di35_Service, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di35_Service, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di35_Service, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di35_Service, null)) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - _singletonM03D01di34_Dependency = new Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Dependency(); - _rootM03D01di._singletonM03D01di34_Dependency = _singletonM03D01di34_Dependency; + _singletonM03D07di34_Dependency = new Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Dependency(); + _rootM03D07di._singletonM03D07di34_Dependency = _singletonM03D07di34_Dependency; } - _singletonM03D01di35_Service = new Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Service(_singletonM03D01di34_Dependency, _rootM03D01di._singletonM03D01di34_Dependency); - _rootM03D01di._singletonM03D01di35_Service = _singletonM03D01di35_Service; + _singletonM03D07di35_Service = new Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.Service(_singletonM03D07di34_Dependency, _rootM03D07di._singletonM03D07di34_Dependency); + _rootM03D07di._singletonM03D07di35_Service = _singletonM03D07di35_Service; } } } - return _rootM03D01di._singletonM03D01di35_Service; + return _rootM03D07di._singletonM03D07di35_Service; } } #endregion @@ -169,7 +169,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -183,7 +183,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -196,10 +196,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -220,10 +220,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -267,26 +267,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.DefaultLifetimeScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -299,7 +299,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 20b839ed..b5d643da 100644 --- a/readme/default-values.md +++ b/readme/default-values.md @@ -98,14 +98,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -114,7 +114,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -144,7 +144,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -158,7 +158,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -171,10 +171,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -195,10 +195,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -242,26 +242,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DefaultValuesScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DefaultValuesScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -274,7 +274,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 a249affa..fb855452 100644 --- a/readme/dependent-compositions.md +++ b/readme/dependent-compositions.md @@ -120,14 +120,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -136,7 +136,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -163,7 +163,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -177,7 +177,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -190,10 +190,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -214,10 +214,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -260,26 +260,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DependentCompositionsScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DependentCompositionsScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -292,7 +292,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.DependentCompositionsScenario.IService Resolve(Composition composition) { @@ -360,14 +360,14 @@ partial class Composition [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class OtherComposition { - private readonly OtherComposition _rootM03D01di; + private readonly OtherComposition _rootM03D07di; /// /// This constructor creates a new instance of . /// public OtherComposition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -376,7 +376,7 @@ partial class OtherComposition /// Base composition. internal OtherComposition(OtherComposition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -414,7 +414,7 @@ partial class OtherComposition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -428,7 +428,7 @@ partial class OtherComposition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -441,10 +441,10 @@ partial class OtherComposition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -465,10 +465,10 @@ partial class OtherComposition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -517,29 +517,29 @@ partial class OtherComposition " OtherComposition ..> Program : Program Program"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static OtherComposition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - var valResolverM03D01di_0001 = new ResolverM03D01di_0001(); - ResolverM03D01di.Value = valResolverM03D01di_0001; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + var valResolverM03D07di_0001 = new ResolverM03D07di_0001(); + ResolverM03D07di.Value = valResolverM03D07di_0001; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DependentCompositionsScenario.IService), valResolverM03D01di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DependentCompositionsScenario.Program), valResolverM03D01di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DependentCompositionsScenario.IService), valResolverM03D07di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.DependentCompositionsScenario.Program), valResolverM03D07di_0001) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(OtherComposition composite) { @@ -552,7 +552,7 @@ partial class OtherComposition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.DependentCompositionsScenario.IService Resolve(OtherComposition composition) { @@ -570,7 +570,7 @@ partial class OtherComposition } } - private sealed class ResolverM03D01di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 f35f5806..e922477b 100644 --- a/readme/disposable-singleton.md +++ b/readme/disposable-singleton.md @@ -111,20 +111,20 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition: global::System.IDisposable { - private readonly Composition _rootM03D01di; - private readonly object _lockM03D01di; - private readonly global::System.IDisposable[] _disposablesM03D01di; - private int _disposeIndexM03D01di; - private Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.Dependency _singletonM03D01di34_Dependency; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; + private readonly global::System.IDisposable[] _disposablesM03D07di; + private int _disposeIndexM03D07di; + private Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.Dependency _singletonM03D07di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); - _disposablesM03D01di = new global::System.IDisposable[1]; + _rootM03D07di = this; + _lockM03D07di = new object(); + _disposablesM03D07di = new global::System.IDisposable[1]; } /// @@ -133,8 +133,8 @@ partial class Composition: global::System.IDisposable /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots @@ -145,19 +145,19 @@ partial class Composition: global::System.IDisposable #endif get { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - _singletonM03D01di34_Dependency = new Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.Dependency(); - _rootM03D01di._singletonM03D01di34_Dependency = _singletonM03D01di34_Dependency; - _rootM03D01di._disposablesM03D01di[_rootM03D01di._disposeIndexM03D01di++] = _singletonM03D01di34_Dependency; + _singletonM03D07di34_Dependency = new Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.Dependency(); + _rootM03D07di._singletonM03D07di34_Dependency = _singletonM03D07di34_Dependency; + _rootM03D07di._disposablesM03D07di[_rootM03D07di._disposeIndexM03D07di++] = _singletonM03D07di34_Dependency; } } } - return new Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.Service(_rootM03D01di._singletonM03D01di34_Dependency); + return new Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.Service(_rootM03D07di._singletonM03D07di34_Dependency); } } #endregion @@ -173,7 +173,7 @@ partial class Composition: global::System.IDisposable #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -187,7 +187,7 @@ partial class Composition: global::System.IDisposable #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -200,10 +200,10 @@ partial class Composition: global::System.IDisposable #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -224,10 +224,10 @@ partial class Composition: global::System.IDisposable #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -244,11 +244,11 @@ partial class Composition: global::System.IDisposable /// public void Dispose() { - lock (_lockM03D01di) + lock (_lockM03D07di) { - while (_disposeIndexM03D01di > 0) + while (_disposeIndexM03D07di > 0) { - var disposableInstance = _disposablesM03D01di[--_disposeIndexM03D01di]; + var disposableInstance = _disposablesM03D07di[--_disposeIndexM03D07di]; try { disposableInstance.Dispose(); @@ -259,7 +259,7 @@ partial class Composition: global::System.IDisposable } } - _singletonM03D01di34_Dependency = null; + _singletonM03D07di34_Dependency = null; } } @@ -298,26 +298,26 @@ partial class Composition: global::System.IDisposable " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.DisposableSingletonScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -330,7 +330,7 @@ partial class Composition: global::System.IDisposable } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 bfcf60f3..2e55b066 100644 --- a/readme/enumerable-generics.md +++ b/readme/enumerable-generics.md @@ -116,14 +116,14 @@ classDiagram /// /// /// -/// IntRoot +/// IntRoot /// /// /// /// /// /// -/// StringRoot +/// StringRoot /// /// /// @@ -144,14 +144,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -160,7 +160,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -172,13 +172,13 @@ partial class Composition get { [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)0x200)] - System.Collections.Generic.IEnumerable> LocalperBlockM03D01di1_IEnumerable() + System.Collections.Generic.IEnumerable> LocalperBlockM03D07di1_IEnumerable() { yield return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.AbcDependency(); yield return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.XyzDependency(); } - var perBlockM03D01di1_IEnumerable = LocalperBlockM03D01di1_IEnumerable(); - return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.Service(perBlockM03D01di1_IEnumerable); + var perBlockM03D07di1_IEnumerable = LocalperBlockM03D07di1_IEnumerable(); + return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.Service(perBlockM03D07di1_IEnumerable); } } @@ -190,13 +190,13 @@ partial class Composition get { [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)0x200)] - System.Collections.Generic.IEnumerable> LocalperBlockM03D01di1_IEnumerable() + System.Collections.Generic.IEnumerable> LocalperBlockM03D07di1_IEnumerable() { yield return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.AbcDependency(); yield return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.XyzDependency(); } - var perBlockM03D01di1_IEnumerable = LocalperBlockM03D01di1_IEnumerable(); - return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.Service(perBlockM03D01di1_IEnumerable); + var perBlockM03D07di1_IEnumerable = LocalperBlockM03D07di1_IEnumerable(); + return new Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.Service(perBlockM03D07di1_IEnumerable); } } #endregion @@ -212,7 +212,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -226,7 +226,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -239,10 +239,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -263,10 +263,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -340,29 +340,29 @@ partial class Composition " ServiceᐸStringᐳ o-- \"PerBlock\" IEnumerableᐸIDependencyᐸStringᐳᐳ : IEnumerableᐸIDependencyᐸStringᐳᐳ"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di>.Value = valResolverM03D01di_0000; - var valResolverM03D01di_0001 = new ResolverM03D01di_0001(); - ResolverM03D01di>.Value = valResolverM03D01di_0001; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di>.Value = valResolverM03D07di_0000; + var valResolverM03D07di_0001 = new ResolverM03D07di_0001(); + ResolverM03D07di>.Value = valResolverM03D07di_0001; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.IService), valResolverM03D01di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.IService), valResolverM03D01di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.IService), valResolverM03D07di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.IService), valResolverM03D07di_0001) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -375,7 +375,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver> + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver> { public Pure.DI.UsageTests.BCL.EnumerableGenericsScenario.IService Resolve(Composition composition) { @@ -393,7 +393,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0001: global::Pure.DI.IResolver> + private sealed class ResolverM03D07di_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 cc27c36f..5b418170 100644 --- a/readme/enumerable.md +++ b/readme/enumerable.md @@ -107,14 +107,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -123,7 +123,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -135,13 +135,13 @@ partial class Composition get { [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)0x200)] - System.Collections.Generic.IEnumerable LocalperBlockM03D01di1_IEnumerable() + System.Collections.Generic.IEnumerable LocalperBlockM03D07di1_IEnumerable() { yield return new Pure.DI.UsageTests.BCL.EnumerableScenario.AbcDependency(); yield return new Pure.DI.UsageTests.BCL.EnumerableScenario.XyzDependency(); } - var perBlockM03D01di1_IEnumerable = LocalperBlockM03D01di1_IEnumerable(); - return new Pure.DI.UsageTests.BCL.EnumerableScenario.Service(perBlockM03D01di1_IEnumerable); + var perBlockM03D07di1_IEnumerable = LocalperBlockM03D07di1_IEnumerable(); + return new Pure.DI.UsageTests.BCL.EnumerableScenario.Service(perBlockM03D07di1_IEnumerable); } } #endregion @@ -157,7 +157,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -171,7 +171,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -184,10 +184,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -208,10 +208,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -261,26 +261,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.EnumerableScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.EnumerableScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -293,7 +293,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 33dbfe23..ccc511f6 100644 --- a/readme/factory.md +++ b/readme/factory.md @@ -109,14 +109,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -125,7 +125,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -136,13 +136,13 @@ partial class Composition #endif get { - Pure.DI.UsageTests.Basics.FactoryScenario.Dependency transientM03D01di1_Dependency; + Pure.DI.UsageTests.Basics.FactoryScenario.Dependency transientM03D07di1_Dependency; { - var dependency_M03D01di1 = new Dependency(DateTimeOffset.Now); - dependency_M03D01di1.Initialize(); - transientM03D01di1_Dependency = dependency_M03D01di1; + var dependency_M03D07di1 = new Dependency(DateTimeOffset.Now); + dependency_M03D07di1.Initialize(); + transientM03D07di1_Dependency = dependency_M03D07di1; } - return new Pure.DI.UsageTests.Basics.FactoryScenario.Service(transientM03D01di1_Dependency); + return new Pure.DI.UsageTests.Basics.FactoryScenario.Service(transientM03D07di1_Dependency); } } #endregion @@ -158,7 +158,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -172,7 +172,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -185,10 +185,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -209,10 +209,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -253,26 +253,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.FactoryScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.FactoryScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -285,7 +285,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 3bf6f959..4fe11674 100644 --- a/readme/field-injection.md +++ b/readme/field-injection.md @@ -98,14 +98,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -114,7 +114,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -125,9 +125,9 @@ partial class Composition #endif get { - var transientM03D01di0_Service = new Pure.DI.UsageTests.Basics.FieldInjectionScenario.Service(); - transientM03D01di0_Service.DependencyVal = new Pure.DI.UsageTests.Basics.FieldInjectionScenario.Dependency(); - return transientM03D01di0_Service; + var transientM03D07di0_Service = new Pure.DI.UsageTests.Basics.FieldInjectionScenario.Service(); + transientM03D07di0_Service.DependencyVal = new Pure.DI.UsageTests.Basics.FieldInjectionScenario.Dependency(); + return transientM03D07di0_Service; } } #endregion @@ -143,7 +143,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -157,7 +157,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -170,10 +170,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -194,10 +194,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -241,26 +241,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.FieldInjectionScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.FieldInjectionScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -273,7 +273,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 6ce61cfe..3fbd5d27 100644 --- a/readme/func-with-arguments.md +++ b/readme/func-with-arguments.md @@ -135,17 +135,17 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; - private readonly object _lockM03D01di; - private Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Clock _singletonM03D01di34_Clock; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; + private Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Clock _singletonM03D07di34_Clock; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); + _rootM03D07di = this; + _lockM03D07di = new object(); } /// @@ -154,8 +154,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots @@ -166,24 +166,24 @@ partial class Composition #endif get { - System.Func transientM03D01di1_Func = dependencyId => + System.Func transientM03D07di1_Func = dependencyId => { - int transientM03D01di3_Int32 = dependencyId; - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Clock, null)) + int transientM03D07di3_Int32 = dependencyId; + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Clock, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Clock, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Clock, null)) { - _singletonM03D01di34_Clock = new Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Clock(); - _rootM03D01di._singletonM03D01di34_Clock = _singletonM03D01di34_Clock; + _singletonM03D07di34_Clock = new Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Clock(); + _rootM03D07di._singletonM03D07di34_Clock = _singletonM03D07di34_Clock; } } } - var dependency_M03D01di1 = new Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Dependency(_rootM03D01di._singletonM03D01di34_Clock, transientM03D01di3_Int32); - return dependency_M03D01di1; + var dependency_M03D07di1 = new Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Dependency(_rootM03D07di._singletonM03D07di34_Clock, transientM03D07di3_Int32); + return dependency_M03D07di1; }; - return new Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Service(transientM03D01di1_Func); + return new Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.Service(transientM03D07di1_Func); } } #endregion @@ -199,7 +199,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -213,7 +213,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -226,10 +226,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -250,10 +250,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -304,26 +304,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.FuncWithArgumentsScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -336,7 +336,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 7385cb8d..6fc682a1 100644 --- a/readme/func.md +++ b/readme/func.md @@ -102,16 +102,16 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; - private readonly object _lockM03D01di; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); + _rootM03D07di = this; + _lockM03D07di = new object(); } /// @@ -120,8 +120,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots @@ -132,15 +132,15 @@ partial class Composition #endif get { - var perResolveM03D01di36_Func = default(System.Func); - perResolveM03D01di36_Func = new global::System.Func( + var perResolveM03D07di36_Func = default(System.Func); + perResolveM03D07di36_Func = new global::System.Func( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - var factory_M03D01di1 = new Pure.DI.UsageTests.BCL.FuncScenario.Dependency(); - return factory_M03D01di1; + var factory_M03D07di1 = new Pure.DI.UsageTests.BCL.FuncScenario.Dependency(); + return factory_M03D07di1; }); - return new Pure.DI.UsageTests.BCL.FuncScenario.Service(perResolveM03D01di36_Func); + return new Pure.DI.UsageTests.BCL.FuncScenario.Service(perResolveM03D07di36_Func); } } #endregion @@ -156,7 +156,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -170,7 +170,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -183,10 +183,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -207,10 +207,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -255,26 +255,26 @@ partial class Composition " FuncᐸIDependencyᐳ *-- Dependency : IDependency"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.FuncScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.FuncScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -287,7 +287,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.FuncScenario.IService Resolve(Composition composition) { diff --git a/readme/generics.md b/readme/generics.md index fa5eb22c..7f54f4fa 100644 --- a/readme/generics.md +++ b/readme/generics.md @@ -121,14 +121,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -137,7 +137,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -164,7 +164,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -178,7 +178,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -191,10 +191,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -215,10 +215,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -269,26 +269,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.GenericsScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.GenericsScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -301,7 +301,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 408b9aaa..6e812519 100644 --- a/readme/injection.md +++ b/readme/injection.md @@ -99,14 +99,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -115,7 +115,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -126,12 +126,12 @@ partial class Composition #endif get { - Pure.DI.UsageTests.Basics.InjectionScenario.Service transientM03D01di0_Service; + Pure.DI.UsageTests.Basics.InjectionScenario.Service transientM03D07di0_Service; { - var dependency_M03D01di1 = new Pure.DI.UsageTests.Basics.InjectionScenario.Dependency(); - transientM03D01di0_Service = new Service(dependency_M03D01di1); + var dependency_M03D07di1 = new Pure.DI.UsageTests.Basics.InjectionScenario.Dependency(); + transientM03D07di0_Service = new Service(dependency_M03D07di1); } - return transientM03D01di0_Service; + return transientM03D07di0_Service; } } #endregion @@ -147,7 +147,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -161,7 +161,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -174,10 +174,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -198,10 +198,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -242,26 +242,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.InjectionScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.InjectionScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -274,7 +274,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 1399d5e5..e3caf547 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 _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -124,7 +124,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots diff --git a/readme/instance-initialization.md b/readme/instance-initialization.md index 65185c1a..8ae4fba7 100644 --- a/readme/instance-initialization.md +++ b/readme/instance-initialization.md @@ -115,8 +115,8 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; - private readonly string _argM03D01di_serviceName; + private readonly Composition _rootM03D07di; + private readonly string _argM03D07di_serviceName; /// /// This parameterized constructor creates a new instance of with arguments. @@ -124,13 +124,13 @@ partial class Composition /// The composition argument of type . public Composition(string serviceName) { - _rootM03D01di = this; + _rootM03D07di = this; if (ReferenceEquals(serviceName, null)) { throw new global::System.ArgumentNullException("serviceName"); } - _argM03D01di_serviceName = serviceName; + _argM03D07di_serviceName = serviceName; } /// @@ -139,8 +139,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _argM03D01di_serviceName = baseComposition._argM03D01di_serviceName; + _rootM03D07di = baseComposition._rootM03D07di; + _argM03D07di_serviceName = baseComposition._argM03D07di_serviceName; } #region Composition Roots @@ -151,13 +151,13 @@ partial class Composition #endif get { - Pure.DI.UsageTests.Basics.InstanceInitializationScenario.Service transientM03D01di0_Service; + Pure.DI.UsageTests.Basics.InstanceInitializationScenario.Service transientM03D07di0_Service; { - var service_M03D01di1 = new Pure.DI.UsageTests.Basics.InstanceInitializationScenario.Service(_argM03D01di_serviceName, new Pure.DI.UsageTests.Basics.InstanceInitializationScenario.Dependency()); - service_M03D01di1.Initialize(); - transientM03D01di0_Service = service_M03D01di1; + var service_M03D07di1 = new Pure.DI.UsageTests.Basics.InstanceInitializationScenario.Service(_argM03D07di_serviceName, new Pure.DI.UsageTests.Basics.InstanceInitializationScenario.Dependency()); + service_M03D07di1.Initialize(); + transientM03D07di0_Service = service_M03D07di1; } - return transientM03D01di0_Service; + return transientM03D07di0_Service; } } #endregion @@ -173,7 +173,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -187,7 +187,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -200,10 +200,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -224,10 +224,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -268,26 +268,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.InstanceInitializationScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.InstanceInitializationScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -300,7 +300,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 1c567ebf..cb79d16a 100644 --- a/readme/interception.md +++ b/readme/interception.md @@ -111,14 +111,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -127,7 +127,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -154,7 +154,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -168,7 +168,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -181,10 +181,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -205,10 +205,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -245,26 +245,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Interception.InterceptionScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Interception.InterceptionScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -277,7 +277,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 0989a655..44dd1fd0 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 RootM03D01di0001 - -IService RootM03D01di0002 + -IDependency RootM03D07di0001 + -IService RootM03D07di0002 + 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 RootM03D01di0001 - Composition ..> Service : "Service Key" IService RootM03D01di0002 + Composition ..> Dependency : "Dependency Key" IDependency RootM03D07di0001 + Composition ..> Service : "Service Key" IService RootM03D07di0002 ``` @@ -105,24 +105,24 @@ classDiagram /// /// /// -/// 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 _rootM03D01di; - private readonly object _lockM03D01di; - private Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Dependency _singletonM03D01di34_Dependency; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; + private Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Dependency _singletonM03D07di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); + _rootM03D07di = this; + _lockM03D07di = new object(); } /// @@ -131,52 +131,52 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots - public Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IDependency RootM03D01di0001 + public Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IDependency RootM03D07di0001 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - _singletonM03D01di34_Dependency = new Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Dependency(); - _rootM03D01di._singletonM03D01di34_Dependency = _singletonM03D01di34_Dependency; + _singletonM03D07di34_Dependency = new Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Dependency(); + _rootM03D07di._singletonM03D07di34_Dependency = _singletonM03D07di34_Dependency; } } } - return _rootM03D01di._singletonM03D01di34_Dependency; + return _rootM03D07di._singletonM03D07di34_Dependency; } } - public Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IService RootM03D01di0002 + public Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IService RootM03D07di0002 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - _singletonM03D01di34_Dependency = new Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Dependency(); - _rootM03D01di._singletonM03D01di34_Dependency = _singletonM03D01di34_Dependency; + _singletonM03D07di34_Dependency = new Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Dependency(); + _rootM03D07di._singletonM03D07di34_Dependency = _singletonM03D07di34_Dependency; } } } - return new Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Service(_rootM03D01di._singletonM03D01di34_Dependency); + return new Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.Service(_rootM03D07di._singletonM03D07di34_Dependency); } } #endregion @@ -192,7 +192,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -206,7 +206,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -219,10 +219,10 @@ partial class Composition #endif public object GetService(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -243,10 +243,10 @@ partial class Composition #endif public object GetRequiredKeyedService(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -265,8 +265,8 @@ partial class Composition return "classDiagram\n" + " class Composition {\n" + - " -IDependency RootM03D01di0001\n" + - " -IService RootM03D01di0002\n" + + " -IDependency RootM03D07di0001\n" + + " -IService RootM03D07di0002\n" + " + T ResolveᐸTᐳ()\n" + " + T ResolveᐸTᐳ(object? tag)\n" + " + object GetService(Type type)\n" + @@ -287,33 +287,33 @@ partial class Composition " <>\n" + " }\n" + " Service o-- \"Singleton\" Dependency : \"Dependency Key\" IDependency\n" + - " Composition ..> Dependency : \"Dependency Key\" IDependency RootM03D01di0001\n" + - " Composition ..> Service : \"Service Key\" IService RootM03D01di0002"; + " Composition ..> Dependency : \"Dependency Key\" IDependency RootM03D07di0001\n" + + " Composition ..> Service : \"Service Key\" IService RootM03D07di0002"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - var valResolverM03D01di_0001 = new ResolverM03D01di_0001(); - ResolverM03D01di.Value = valResolverM03D01di_0001; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + var valResolverM03D07di_0001 = new ResolverM03D07di_0001(); + ResolverM03D07di.Value = valResolverM03D07di_0001; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IDependency), valResolverM03D01di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IService), valResolverM03D01di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IDependency), valResolverM03D07di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IService), valResolverM03D07di_0001) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -326,7 +326,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IDependency Resolve(Composition composition) { @@ -338,13 +338,13 @@ partial class Composition switch (tag) { case "Dependency Key": - return composition.RootM03D01di0001; + return composition.RootM03D07di0001; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IDependency."); } } - private sealed class ResolverM03D01di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.KeyedServiceProviderScenario.IService Resolve(Composition composition) { @@ -356,7 +356,7 @@ partial class Composition switch (tag) { case "Service Key": - return composition.RootM03D01di0002; + return composition.RootM03D07di0002; } 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 b454e4af..95736104 100644 --- a/readme/lazy.md +++ b/readme/lazy.md @@ -96,16 +96,16 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; - private readonly object _lockM03D01di; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); + _rootM03D07di = this; + _lockM03D07di = new object(); } /// @@ -114,8 +114,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots @@ -126,20 +126,20 @@ partial class Composition #endif get { - var perResolveM03D01di37_Func = default(System.Func); - perResolveM03D01di37_Func = new global::System.Func( + var perResolveM03D07di37_Func = default(System.Func); + perResolveM03D07di37_Func = new global::System.Func( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - var factory_M03D01di1 = new Pure.DI.UsageTests.BCL.LazyScenario.Dependency(); - return factory_M03D01di1; + var factory_M03D07di1 = new Pure.DI.UsageTests.BCL.LazyScenario.Dependency(); + return factory_M03D07di1; }); - System.Lazy transientM03D01di1_Lazy; + System.Lazy transientM03D07di1_Lazy; { - var factory_M03D01di2 = perResolveM03D01di37_Func; - transientM03D01di1_Lazy = new global::System.Lazy(factory_M03D01di2, true); + var factory_M03D07di2 = perResolveM03D07di37_Func; + transientM03D07di1_Lazy = new global::System.Lazy(factory_M03D07di2, true); } - return new Pure.DI.UsageTests.BCL.LazyScenario.Service(transientM03D01di1_Lazy); + return new Pure.DI.UsageTests.BCL.LazyScenario.Service(transientM03D07di1_Lazy); } } #endregion @@ -155,7 +155,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -169,7 +169,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -182,10 +182,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -206,10 +206,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -256,26 +256,26 @@ partial class Composition " FuncᐸIDependencyᐳ *-- Dependency : IDependency"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.LazyScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.LazyScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -288,7 +288,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 d25fbbc0..70262728 100644 --- a/readme/manually-started-tasks.md +++ b/readme/manually-started-tasks.md @@ -137,16 +137,16 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; - private readonly object _lockM03D01di; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; /// /// This parameterized constructor creates a new instance of with arguments. /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); + _rootM03D07di = this; + _lockM03D07di = new object(); } /// @@ -155,8 +155,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots @@ -165,21 +165,21 @@ partial class Composition #endif public Pure.DI.UsageTests.BCL.ManualTaskScenario.IService GetRoot(System.Threading.CancellationToken cancellationToken) { - var perResolveM03D01di39_Func = default(System.Func); - perResolveM03D01di39_Func = new global::System.Func( + var perResolveM03D07di39_Func = default(System.Func); + perResolveM03D07di39_Func = new global::System.Func( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - var factory_M03D01di1 = new Pure.DI.UsageTests.BCL.ManualTaskScenario.Dependency(); - return factory_M03D01di1; + var factory_M03D07di1 = new Pure.DI.UsageTests.BCL.ManualTaskScenario.Dependency(); + return factory_M03D07di1; }); - System.Threading.Tasks.Task transientM03D01di1_Task; + System.Threading.Tasks.Task transientM03D07di1_Task; { - var factory_M03D01di2 = perResolveM03D01di39_Func; - var cancellationToken_M03D01di3 = cancellationToken; - transientM03D01di1_Task = new Task(factory_M03D01di2, cancellationToken_M03D01di3); + var factory_M03D07di2 = perResolveM03D07di39_Func; + var cancellationToken_M03D07di3 = cancellationToken; + transientM03D07di1_Task = new Task(factory_M03D07di2, cancellationToken_M03D07di3); } - return new Pure.DI.UsageTests.BCL.ManualTaskScenario.Service(transientM03D01di1_Task); + return new Pure.DI.UsageTests.BCL.ManualTaskScenario.Service(transientM03D07di1_Task); } #endregion diff --git a/readme/member-ordinal-attribute.md b/readme/member-ordinal-attribute.md index 8aaf10da..fdd74358 100644 --- a/readme/member-ordinal-attribute.md +++ b/readme/member-ordinal-attribute.md @@ -125,10 +125,10 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class PersonComposition { - private readonly PersonComposition _rootM03D01di; - private readonly int _argM03D01di_personId; - private readonly string _argM03D01di_personName; - private readonly System.DateTime _argM03D01di_personBirthday; + private readonly PersonComposition _rootM03D07di; + private readonly int _argM03D07di_personId; + private readonly string _argM03D07di_personName; + private readonly System.DateTime _argM03D07di_personBirthday; /// /// This parameterized constructor creates a new instance of with arguments. @@ -138,15 +138,15 @@ partial class PersonComposition /// The composition argument of type . public PersonComposition(int personId, string personName, System.DateTime personBirthday) { - _rootM03D01di = this; + _rootM03D07di = this; if (ReferenceEquals(personName, null)) { throw new global::System.ArgumentNullException("personName"); } - _argM03D01di_personId = personId; - _argM03D01di_personName = personName; - _argM03D01di_personBirthday = personBirthday; + _argM03D07di_personId = personId; + _argM03D07di_personName = personName; + _argM03D07di_personBirthday = personBirthday; } /// @@ -155,10 +155,10 @@ partial class PersonComposition /// Base composition. internal PersonComposition(PersonComposition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _argM03D01di_personId = baseComposition._argM03D01di_personId; - _argM03D01di_personName = baseComposition._argM03D01di_personName; - _argM03D01di_personBirthday = baseComposition._argM03D01di_personBirthday; + _rootM03D07di = baseComposition._rootM03D07di; + _argM03D07di_personId = baseComposition._argM03D07di_personId; + _argM03D07di_personName = baseComposition._argM03D07di_personName; + _argM03D07di_personBirthday = baseComposition._argM03D07di_personBirthday; } #region Composition Roots @@ -169,11 +169,11 @@ partial class PersonComposition #endif get { - var transientM03D01di0_Person = new Pure.DI.UsageTests.Attributes.MemberOrdinalAttributeScenario.Person(); - transientM03D01di0_Person.Id = _argM03D01di_personId; - transientM03D01di0_Person.FirstName = _argM03D01di_personName; - transientM03D01di0_Person.Birthday = _argM03D01di_personBirthday; - return transientM03D01di0_Person; + var transientM03D07di0_Person = new Pure.DI.UsageTests.Attributes.MemberOrdinalAttributeScenario.Person(); + transientM03D07di0_Person.Id = _argM03D07di_personId; + transientM03D07di0_Person.FirstName = _argM03D07di_personName; + transientM03D07di0_Person.Birthday = _argM03D07di_personBirthday; + return transientM03D07di0_Person; } } #endregion @@ -189,7 +189,7 @@ partial class PersonComposition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -203,7 +203,7 @@ partial class PersonComposition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -216,10 +216,10 @@ partial class PersonComposition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -240,10 +240,10 @@ partial class PersonComposition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -287,26 +287,26 @@ partial class PersonComposition " PersonComposition ..> Person : IPerson Person"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static PersonComposition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.MemberOrdinalAttributeScenario.IPerson), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.MemberOrdinalAttributeScenario.IPerson), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(PersonComposition composite) { @@ -319,7 +319,7 @@ partial class PersonComposition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 646525e7..ef617ae8 100644 --- a/readme/method-injection.md +++ b/readme/method-injection.md @@ -99,14 +99,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -115,7 +115,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -126,9 +126,9 @@ partial class Composition #endif get { - var transientM03D01di0_Service = new Pure.DI.UsageTests.Basics.MethodInjectionScenario.Service(); - transientM03D01di0_Service.SetDependency(new Pure.DI.UsageTests.Basics.MethodInjectionScenario.Dependency()); - return transientM03D01di0_Service; + var transientM03D07di0_Service = new Pure.DI.UsageTests.Basics.MethodInjectionScenario.Service(); + transientM03D07di0_Service.SetDependency(new Pure.DI.UsageTests.Basics.MethodInjectionScenario.Dependency()); + return transientM03D07di0_Service; } } #endregion @@ -144,7 +144,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -158,7 +158,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -171,10 +171,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -195,10 +195,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -242,26 +242,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.MethodInjectionScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.MethodInjectionScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -274,7 +274,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 3a697321..614efbef 100644 --- a/readme/multi-contract-bindings.md +++ b/readme/multi-contract-bindings.md @@ -99,14 +99,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -115,7 +115,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -142,7 +142,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -156,7 +156,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -169,10 +169,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -193,10 +193,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -244,26 +244,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.MultiContractBindingsScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.MultiContractBindingsScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -276,7 +276,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 1a53ba68..965749ec 100644 --- a/readme/oncannotresolve-hint.md +++ b/readme/oncannotresolve-hint.md @@ -124,14 +124,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -140,7 +140,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -151,8 +151,8 @@ partial class Composition #endif get { - var transientM03D01di2_String = OnCannotResolve(null, Pure.DI.Lifetime.Transient); - return new Pure.DI.UsageTests.Hints.OnCannotResolveHintScenario.Service(new Pure.DI.UsageTests.Hints.OnCannotResolveHintScenario.Dependency(transientM03D01di2_String)); + var transientM03D07di2_String = OnCannotResolve(null, Pure.DI.Lifetime.Transient); + return new Pure.DI.UsageTests.Hints.OnCannotResolveHintScenario.Service(new Pure.DI.UsageTests.Hints.OnCannotResolveHintScenario.Dependency(transientM03D07di2_String)); } } #endregion @@ -168,7 +168,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -182,7 +182,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -195,10 +195,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -219,10 +219,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -269,26 +269,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.OnCannotResolveHintScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.OnCannotResolveHintScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -301,7 +301,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 b61ff86d..5ad14cc2 100644 --- a/readme/ondependencyinjection-hint.md +++ b/readme/ondependencyinjection-hint.md @@ -121,14 +121,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -137,7 +137,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -164,7 +164,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -178,7 +178,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -191,10 +191,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -215,10 +215,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -263,26 +263,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.OnDependencyInjectionHintScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.OnDependencyInjectionHintScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -295,7 +295,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 b3d2e185..b2dccf20 100644 --- a/readme/onnewinstance-hint.md +++ b/readme/onnewinstance-hint.md @@ -123,17 +123,17 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; - private readonly object _lockM03D01di; - private Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Dependency _singletonM03D01di34_Dependency; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; + private Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Dependency _singletonM03D07di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); + _rootM03D07di = this; + _lockM03D07di = new object(); } /// @@ -142,8 +142,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots @@ -154,24 +154,24 @@ partial class Composition #endif get { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Dependency _singletonM03D01di34_DependencyTemp; - _singletonM03D01di34_DependencyTemp = new Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Dependency(); - OnNewInstance(ref _singletonM03D01di34_DependencyTemp, null, Pure.DI.Lifetime.Singleton); + Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Dependency _singletonM03D07di34_DependencyTemp; + _singletonM03D07di34_DependencyTemp = new Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Dependency(); + OnNewInstance(ref _singletonM03D07di34_DependencyTemp, null, Pure.DI.Lifetime.Singleton); global::System.Threading.Thread.MemoryBarrier(); - _singletonM03D01di34_Dependency = _singletonM03D01di34_DependencyTemp; - _rootM03D01di._singletonM03D01di34_Dependency = _singletonM03D01di34_Dependency; + _singletonM03D07di34_Dependency = _singletonM03D07di34_DependencyTemp; + _rootM03D07di._singletonM03D07di34_Dependency = _singletonM03D07di34_Dependency; } } } - var transientM03D01di0_Service = new Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Service(_rootM03D01di._singletonM03D01di34_Dependency); - OnNewInstance(ref transientM03D01di0_Service, null, Pure.DI.Lifetime.Transient); - return transientM03D01di0_Service; + var transientM03D07di0_Service = new Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.Service(_rootM03D07di._singletonM03D07di34_Dependency); + OnNewInstance(ref transientM03D07di0_Service, null, Pure.DI.Lifetime.Transient); + return transientM03D07di0_Service; } } #endregion @@ -187,7 +187,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -201,7 +201,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -214,10 +214,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -238,10 +238,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -286,26 +286,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.OnNewInstanceHintScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -318,7 +318,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 75d7547f..6f11e77e 100644 --- a/readme/overriding-the-bcl-binding.md +++ b/readme/overriding-the-bcl-binding.md @@ -98,14 +98,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -114,7 +114,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -125,13 +125,13 @@ partial class Composition #endif get { - Pure.DI.UsageTests.BCL.OverridingBclBindingScenario.IDependency[] transientM03D01di1_ = new IDependency[] + Pure.DI.UsageTests.BCL.OverridingBclBindingScenario.IDependency[] transientM03D07di1_ = new IDependency[] { new AbcDependency(), new XyzDependency(), new AbcDependency() }; - return new Pure.DI.UsageTests.BCL.OverridingBclBindingScenario.Service(transientM03D01di1_); + return new Pure.DI.UsageTests.BCL.OverridingBclBindingScenario.Service(transientM03D07di1_); } } #endregion @@ -147,7 +147,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -161,7 +161,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -174,10 +174,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -198,10 +198,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -238,26 +238,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.OverridingBclBindingScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.OverridingBclBindingScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -270,7 +270,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 ff08bc86..6d194865 100644 --- a/readme/partial-class.md +++ b/readme/partial-class.md @@ -5,27 +5,62 @@ A partial class can contain setup code. ```c# -interface IDependency; +interface IDependency +{ + long Id { get; } +} -class Dependency : IDependency; +class Dependency(long id) : IDependency +{ + public long Id { get; } = id; +} -interface IService; +class Service( + [Tag("name with id")] string name, + IDependency dependency1, + IDependency dependency2) +{ + public string Name { get; } = name; + + public IDependency Dependency1 { get; } = dependency1; -class Service(IDependency dependency) : IService; + public IDependency Dependency2 { get; } = dependency2; +} // The partial class is also useful for specifying access modifiers to the generated class -partial class Composition +public partial class Composition { - // This method will not be called in runtime + private readonly string _serviceName; + private long _id; + + // Customizable constructor + public Composition(string serviceName) + : this() + { + _serviceName = serviceName; + } + + private long GenerateId() => Interlocked.Increment(ref _id); + + // In fact, this method will not be called at runtime [Conditional("DI")] private void Setup() => DI.Setup(nameof(Composition)) .Bind().To() - .Bind().To().Root("Root"); + .Bind().To(_ => GenerateId()) + .Bind("name with id").To( + _ => $"{_serviceName}_{GenerateId()}") + .Root( + "Root", + kind: RootKinds.Internal); } -var composition = new Composition(); +var composition = new Composition("Abc"); var service = composition.Root; + +service.Dependency1.Id.ShouldBe(1); +service.Dependency2.Id.ShouldBe(2); +service.Name.ShouldBe("Abc_3"); ``` The partial class is also useful for specifying access modifiers to the generated class. @@ -36,28 +71,29 @@ The partial class is also useful for specifying access modifiers to the generate ```mermaid classDiagram class Composition { - +IService Root + +Service Root + T ResolveᐸTᐳ() + T ResolveᐸTᐳ(object? tag) + object Resolve(Type type) + object Resolve(Type type, object? tag) } + class Service { + +Service(String name, IDependency dependency1, IDependency dependency2) + } + class Int64 + class String Dependency --|> IDependency : class Dependency { - +Dependency() - } - Service --|> IService : - class Service { - +Service(IDependency dependency) + +Dependency(Int64 id) } class IDependency { <> } - class IService { - <> - } + Service *-- String : "name with id" String + Service *-- Dependency : IDependency Service *-- Dependency : IDependency - Composition ..> Service : IService Root + Dependency *-- Int64 : Int64 + Composition ..> Service : Service Root ``` @@ -89,21 +125,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 _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -112,18 +148,21 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots - public Pure.DI.UsageTests.Basics.PartialClassScenario.IService Root + internal Pure.DI.UsageTests.Basics.PartialClassScenario.Service Root { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - return new Pure.DI.UsageTests.Basics.PartialClassScenario.Service(new Pure.DI.UsageTests.Basics.PartialClassScenario.Dependency()); + long transientM03D07di5_Int64 = GenerateId(); + long transientM03D07di4_Int64 = GenerateId(); + string transientM03D07di1_String = $"{_serviceName}_{GenerateId()}"; + return new Pure.DI.UsageTests.Basics.PartialClassScenario.Service(transientM03D07di1_String, new Pure.DI.UsageTests.Basics.PartialClassScenario.Dependency(transientM03D07di5_Int64), new Pure.DI.UsageTests.Basics.PartialClassScenario.Dependency(transientM03D07di4_Int64)); } } #endregion @@ -139,7 +178,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -153,7 +192,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -166,10 +205,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -190,10 +229,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -212,50 +251,51 @@ partial class Composition return "classDiagram\n" + " class Composition {\n" + - " +IService Root\n" + + " +Service Root\n" + " + T ResolveᐸTᐳ()\n" + " + T ResolveᐸTᐳ(object? tag)\n" + " + object Resolve(Type type)\n" + " + object Resolve(Type type, object? tag)\n" + " }\n" + + " class Service {\n" + + " +Service(String name, IDependency dependency1, IDependency dependency2)\n" + + " }\n" + + " class Int64\n" + + " class String\n" + " Dependency --|> IDependency : \n" + " class Dependency {\n" + - " +Dependency()\n" + - " }\n" + - " Service --|> IService : \n" + - " class Service {\n" + - " +Service(IDependency dependency)\n" + + " +Dependency(Int64 id)\n" + " }\n" + " class IDependency {\n" + " <>\n" + " }\n" + - " class IService {\n" + - " <>\n" + - " }\n" + + " Service *-- String : \"name with id\" String\n" + + " Service *-- Dependency : IDependency\n" + " Service *-- Dependency : IDependency\n" + - " Composition ..> Service : IService Root"; + " Dependency *-- Int64 : Int64\n" + + " Composition ..> Service : Service Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.PartialClassScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.PartialClassScenario.Service), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -268,21 +308,21 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { - public Pure.DI.UsageTests.Basics.PartialClassScenario.IService Resolve(Composition composition) + public Pure.DI.UsageTests.Basics.PartialClassScenario.Service Resolve(Composition composition) { return composition.Root; } - public Pure.DI.UsageTests.Basics.PartialClassScenario.IService ResolveByTag(Composition composition, object tag) + public Pure.DI.UsageTests.Basics.PartialClassScenario.Service ResolveByTag(Composition composition, object tag) { switch (tag) { case null: return composition.Root; } - throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.PartialClassScenario.IService."); + throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.Basics.PartialClassScenario.Service."); } } #endregion diff --git a/readme/perblock.md b/readme/perblock.md index 565c247c..30f47e8e 100644 --- a/readme/perblock.md +++ b/readme/perblock.md @@ -9,26 +9,18 @@ interface IDependency; class Dependency : IDependency; -class Service +class Service( + IDependency dep1, + IDependency dep2, + Lazy<(IDependency dep3, IDependency dep4)> deps) { - public Service( - IDependency dep1, - IDependency dep2, - Lazy<(IDependency dep3, IDependency dep4)> deps) - { - Dep1 = dep1; - Dep2 = dep2; - Dep3 = deps.Value.dep3; - Dep4 = deps.Value.dep4; - } - - public IDependency Dep1 { get; } + public IDependency Dep1 { get; } = dep1; - public IDependency Dep2 { get; } + public IDependency Dep2 { get; } = dep2; - public IDependency Dep3 { get; } + public IDependency Dep3 { get; } = deps.Value.dep3; - public IDependency Dep4 { get; } + public IDependency Dep4 { get; } = deps.Value.dep4; } DI.Setup(nameof(Composition)) @@ -119,16 +111,16 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; - private readonly object _lockM03D01di; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); + _rootM03D07di = this; + _lockM03D07di = new object(); } /// @@ -137,8 +129,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots @@ -149,22 +141,22 @@ partial class Composition #endif get { - var perResolveM03D01di40_Func = default(System.Func<(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep4)>); - perResolveM03D01di40_Func = new global::System.Func<(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep4)>( + var perResolveM03D07di40_Func = default(System.Func<(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep4)>); + perResolveM03D07di40_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 perBlockM03D01di4_Dependency = new Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Dependency(); - var factory_M03D01di1 = (perBlockM03D01di4_Dependency, perBlockM03D01di4_Dependency); - return factory_M03D01di1; + var perBlockM03D07di4_Dependency = new Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Dependency(); + var factory_M03D07di1 = (perBlockM03D07di4_Dependency, perBlockM03D07di4_Dependency); + return factory_M03D07di1; }); - System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep4)> transientM03D01di2_Lazy; + System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep4)> transientM03D07di2_Lazy; { - var factory_M03D01di2 = perResolveM03D01di40_Func; - transientM03D01di2_Lazy = new global::System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep4)>(factory_M03D01di2, true); + var factory_M03D07di2 = perResolveM03D07di40_Func; + transientM03D07di2_Lazy = new global::System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerBlockScenario.IDependency dep4)>(factory_M03D07di2, true); } - var perBlockM03D01di1_Dependency = new Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Dependency(); - return new Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Service(perBlockM03D01di1_Dependency, perBlockM03D01di1_Dependency, transientM03D01di2_Lazy); + var perBlockM03D07di1_Dependency = new Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Dependency(); + return new Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Service(perBlockM03D07di1_Dependency, perBlockM03D07di1_Dependency, transientM03D07di2_Lazy); } } #endregion @@ -180,7 +172,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -194,7 +186,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -207,10 +199,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -231,10 +223,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -284,26 +276,26 @@ partial class Composition " FuncᐸValueTupleᐸIDependencyˏIDependencyᐳᐳ *-- ValueTupleᐸIDependencyˏIDependencyᐳ : ValueTupleᐸIDependencyˏIDependencyᐳ"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Service), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.PerBlockScenario.Service), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -316,7 +308,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 eb330060..9e244d5a 100644 --- a/readme/perresolve.md +++ b/readme/perresolve.md @@ -9,26 +9,18 @@ interface IDependency; class Dependency : IDependency; -class Service +class Service( + IDependency dep1, + IDependency dep2, + Lazy<(IDependency dep3, IDependency dep4)> deps) { - public Service( - IDependency dep1, - IDependency dep2, - Lazy<(IDependency dep3, IDependency dep4)> deps) - { - Dep1 = dep1; - Dep2 = dep2; - Dep3 = deps.Value.dep3; - Dep4 = deps.Value.dep4; - } - - public IDependency Dep1 { get; } + public IDependency Dep1 { get; } = dep1; - public IDependency Dep2 { get; } + public IDependency Dep2 { get; } = dep2; - public IDependency Dep3 { get; } + public IDependency Dep3 { get; } = deps.Value.dep3; - public IDependency Dep4 { get; } + public IDependency Dep4 { get; } = deps.Value.dep4; } DI.Setup(nameof(Composition)) @@ -119,16 +111,16 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; - private readonly object _lockM03D01di; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); + _rootM03D07di = this; + _lockM03D07di = new object(); } /// @@ -137,8 +129,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots @@ -149,41 +141,41 @@ partial class Composition #endif get { - var perResolveM03D01di34_Dependency = default(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Dependency); - var perResolveM03D01di40_Func = default(System.Func<(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep4)>); - perResolveM03D01di40_Func = new global::System.Func<(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep4)>( + var perResolveM03D07di34_Dependency = default(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Dependency); + var perResolveM03D07di40_Func = default(System.Func<(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep4)>); + perResolveM03D07di40_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(perResolveM03D01di34_Dependency, null)) + if (ReferenceEquals(perResolveM03D07di34_Dependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(perResolveM03D01di34_Dependency, null)) + if (ReferenceEquals(perResolveM03D07di34_Dependency, null)) { - perResolveM03D01di34_Dependency = new Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Dependency(); + perResolveM03D07di34_Dependency = new Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Dependency(); } } } - var factory_M03D01di1 = (perResolveM03D01di34_Dependency, perResolveM03D01di34_Dependency); - return factory_M03D01di1; + var factory_M03D07di1 = (perResolveM03D07di34_Dependency, perResolveM03D07di34_Dependency); + return factory_M03D07di1; }); - System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep4)> transientM03D01di1_Lazy; + System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep4)> transientM03D07di1_Lazy; { - var factory_M03D01di2 = perResolveM03D01di40_Func; - transientM03D01di1_Lazy = new global::System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep4)>(factory_M03D01di2, true); + var factory_M03D07di2 = perResolveM03D07di40_Func; + transientM03D07di1_Lazy = new global::System.Lazy<(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep3, Pure.DI.UsageTests.Lifetimes.PerResolveScenario.IDependency dep4)>(factory_M03D07di2, true); } - if (ReferenceEquals(perResolveM03D01di34_Dependency, null)) + if (ReferenceEquals(perResolveM03D07di34_Dependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(perResolveM03D01di34_Dependency, null)) + if (ReferenceEquals(perResolveM03D07di34_Dependency, null)) { - perResolveM03D01di34_Dependency = new Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Dependency(); + perResolveM03D07di34_Dependency = new Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Dependency(); } } } - return new Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Service(perResolveM03D01di34_Dependency, perResolveM03D01di34_Dependency, transientM03D01di1_Lazy); + return new Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Service(perResolveM03D07di34_Dependency, perResolveM03D07di34_Dependency, transientM03D07di1_Lazy); } } #endregion @@ -199,7 +191,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -213,7 +205,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -226,10 +218,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -250,10 +242,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -303,26 +295,26 @@ partial class Composition " FuncᐸValueTupleᐸIDependencyˏIDependencyᐳᐳ *-- ValueTupleᐸIDependencyˏIDependencyᐳ : ValueTupleᐸIDependencyˏIDependencyᐳ"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Service), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.PerResolveScenario.Service), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -335,7 +327,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 76b56fab..a81e949b 100644 --- a/readme/property-injection.md +++ b/readme/property-injection.md @@ -96,14 +96,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -112,7 +112,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -123,9 +123,9 @@ partial class Composition #endif get { - var transientM03D01di0_Service = new Pure.DI.UsageTests.Basics.PropertyInjectionScenario.Service(); - transientM03D01di0_Service.Dependency = new Pure.DI.UsageTests.Basics.PropertyInjectionScenario.Dependency(); - return transientM03D01di0_Service; + var transientM03D07di0_Service = new Pure.DI.UsageTests.Basics.PropertyInjectionScenario.Service(); + transientM03D07di0_Service.Dependency = new Pure.DI.UsageTests.Basics.PropertyInjectionScenario.Dependency(); + return transientM03D07di0_Service; } } #endregion @@ -141,7 +141,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -155,7 +155,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -168,10 +168,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -192,10 +192,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -239,26 +239,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.PropertyInjectionScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.PropertyInjectionScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -271,7 +271,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 e7d92c21..46810ef3 100644 --- a/readme/required-properties-or-fields.md +++ b/readme/required-properties-or-fields.md @@ -106,8 +106,8 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; - private readonly string _argM03D01di_name; + private readonly Composition _rootM03D07di; + private readonly string _argM03D07di_name; /// /// This parameterized constructor creates a new instance of with arguments. @@ -115,13 +115,13 @@ partial class Composition /// The composition argument of type . public Composition(string name) { - _rootM03D01di = this; + _rootM03D07di = this; if (ReferenceEquals(name, null)) { throw new global::System.ArgumentNullException("name"); } - _argM03D01di_name = name; + _argM03D07di_name = name; } /// @@ -130,8 +130,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _argM03D01di_name = baseComposition._argM03D01di_name; + _rootM03D07di = baseComposition._rootM03D07di; + _argM03D07di_name = baseComposition._argM03D07di_name; } #region Composition Roots @@ -144,7 +144,7 @@ partial class Composition { return new Pure.DI.UsageTests.Basics.RequiredPropertiesOrFieldsScenario.Service() { - ServiceNameField = _argM03D01di_name, + ServiceNameField = _argM03D07di_name, Dependency = new Pure.DI.UsageTests.Basics.RequiredPropertiesOrFieldsScenario.Dependency() }; } @@ -162,7 +162,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -176,7 +176,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -189,10 +189,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -213,10 +213,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -263,26 +263,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.RequiredPropertiesOrFieldsScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.RequiredPropertiesOrFieldsScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -295,7 +295,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 426e5370..236162fe 100644 --- a/readme/resolve-hint.md +++ b/readme/resolve-hint.md @@ -99,14 +99,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -115,7 +115,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots diff --git a/readme/resolve-methods.md b/readme/resolve-methods.md index 2742594a..761d3be7 100644 --- a/readme/resolve-methods.md +++ b/readme/resolve-methods.md @@ -47,7 +47,7 @@ classDiagram class Composition { +IDependency DependencySingleton +IService OtherService - -IService RootM03D01di0002 + -IService RootM03D07di0002 + 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 RootM03D01di0002 + Composition ..> Service : IService RootM03D07di0002 Composition ..> OtherService : "Other" IService OtherService ``` @@ -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 _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -149,7 +149,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #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 RootM03D01di0002 + public Pure.DI.UsageTests.Basics.ResolveScenario.IService RootM03D07di0002 { #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 ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -224,7 +224,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -237,10 +237,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[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)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[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 RootM03D01di0002\n" + + " -IService RootM03D07di0002\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 RootM03D01di0002\n" + + " Composition ..> Service : IService RootM03D07di0002\n" + " Composition ..> OtherService : \"Other\" IService OtherService"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - var valResolverM03D01di_0001 = new ResolverM03D01di_0001(); - ResolverM03D01di.Value = valResolverM03D01di_0001; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + var valResolverM03D07di_0001 = new ResolverM03D07di_0001(); + ResolverM03D07di.Value = valResolverM03D07di_0001; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ResolveScenario.IDependency), valResolverM03D01di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ResolveScenario.IService), valResolverM03D01di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ResolveScenario.IDependency), valResolverM03D07di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.ResolveScenario.IService), valResolverM03D07di_0001) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -350,7 +350,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 ResolverM03D01di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.ResolveScenario.IService Resolve(Composition composition) { - return composition.RootM03D01di0002; + return composition.RootM03D07di0002; } 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.RootM03D01di0002; + return composition.RootM03D07di0002; } 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 a6a29984..cd12c723 100644 --- a/readme/root-arguments.md +++ b/readme/root-arguments.md @@ -126,14 +126,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This parameterized constructor creates a new instance of with arguments. /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -142,7 +142,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots diff --git a/readme/scope.md b/readme/scope.md index d10639fb..2270f5e7 100644 --- a/readme/scope.md +++ b/readme/scope.md @@ -165,20 +165,20 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition: global::System.IDisposable { - private readonly Composition _rootM03D01di; - private readonly object _lockM03D01di; - private readonly global::System.IDisposable[] _disposablesM03D01di; - private int _disposeIndexM03D01di; - private Pure.DI.UsageTests.Lifetimes.ScopeScenario.Dependency _scopedM03D01di34_Dependency; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; + private readonly global::System.IDisposable[] _disposablesM03D07di; + private int _disposeIndexM03D07di; + private Pure.DI.UsageTests.Lifetimes.ScopeScenario.Dependency _scopedM03D07di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); - _disposablesM03D01di = new global::System.IDisposable[1]; + _rootM03D07di = this; + _lockM03D07di = new object(); + _disposablesM03D07di = new global::System.IDisposable[1]; } /// @@ -187,9 +187,9 @@ partial class Composition: global::System.IDisposable /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; - _disposablesM03D01di = new global::System.IDisposable[1]; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; + _disposablesM03D07di = new global::System.IDisposable[1]; } #region Composition Roots @@ -203,18 +203,18 @@ partial class Composition: global::System.IDisposable #endif get { - if (ReferenceEquals(_scopedM03D01di34_Dependency, null)) + if (ReferenceEquals(_scopedM03D07di34_Dependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_scopedM03D01di34_Dependency, null)) + if (ReferenceEquals(_scopedM03D07di34_Dependency, null)) { - _scopedM03D01di34_Dependency = new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Dependency(); - _disposablesM03D01di[_disposeIndexM03D01di++] = _scopedM03D01di34_Dependency; + _scopedM03D07di34_Dependency = new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Dependency(); + _disposablesM03D07di[_disposeIndexM03D07di++] = _scopedM03D07di34_Dependency; } } } - return new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Service(_scopedM03D01di34_Dependency); + return new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Service(_scopedM03D07di34_Dependency); } } @@ -228,16 +228,16 @@ partial class Composition: global::System.IDisposable #endif get { - var perResolveM03D01di40_Func = default(System.Func); - perResolveM03D01di40_Func = new global::System.Func( + var perResolveM03D07di40_Func = default(System.Func); + perResolveM03D07di40_Func = new global::System.Func( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - var transientM03D01di2_Composition = this; - var factory_M03D01di1 = new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Session(transientM03D01di2_Composition); - return factory_M03D01di1; + var transientM03D07di2_Composition = this; + var factory_M03D07di1 = new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Session(transientM03D07di2_Composition); + return factory_M03D07di1; }); - return new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Program(perResolveM03D01di40_Func); + return new Pure.DI.UsageTests.Lifetimes.ScopeScenario.Program(perResolveM03D07di40_Func); } } #endregion @@ -253,7 +253,7 @@ partial class Composition: global::System.IDisposable #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -267,7 +267,7 @@ partial class Composition: global::System.IDisposable #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.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)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[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)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[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 (_lockM03D01di) + lock (_lockM03D07di) { - while (_disposeIndexM03D01di > 0) + while (_disposeIndexM03D07di > 0) { - var disposableInstance = _disposablesM03D01di[--_disposeIndexM03D01di]; + var disposableInstance = _disposablesM03D07di[--_disposeIndexM03D07di]; try { disposableInstance.Dispose(); @@ -339,7 +339,7 @@ partial class Composition: global::System.IDisposable } } - _scopedM03D01di34_Dependency = null; + _scopedM03D07di34_Dependency = null; } } @@ -391,29 +391,29 @@ partial class Composition: global::System.IDisposable " FuncᐸSessionᐳ *-- Session : Session"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - var valResolverM03D01di_0001 = new ResolverM03D01di_0001(); - ResolverM03D01di.Value = valResolverM03D01di_0001; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + var valResolverM03D07di_0001 = new ResolverM03D07di_0001(); + ResolverM03D07di.Value = valResolverM03D07di_0001; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.ScopeScenario.IService), valResolverM03D01di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.ScopeScenario.Program), valResolverM03D01di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.ScopeScenario.IService), valResolverM03D07di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.ScopeScenario.Program), valResolverM03D07di_0001) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -426,7 +426,7 @@ partial class Composition: global::System.IDisposable } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 ResolverM03D01di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 744c2c3e..d2871990 100644 --- a/readme/service-collection.md +++ b/readme/service-collection.md @@ -47,8 +47,8 @@ service.Dependency.ShouldBe(dependency); ```mermaid classDiagram class Composition { - -IDependency RootM03D01di0001 - -IService RootM03D01di0002 + -IDependency RootM03D07di0001 + -IService RootM03D07di0002 + 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 RootM03D01di0001 - Composition ..> Service : IService RootM03D01di0002 + Composition ..> Dependency : "Dependency Key" IDependency RootM03D07di0001 + Composition ..> Service : IService RootM03D07di0002 ``` @@ -102,24 +102,24 @@ classDiagram /// /// /// -/// 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 _rootM03D01di; - private readonly object _lockM03D01di; - private Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Dependency _singletonM03D01di34_Dependency; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; + private Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Dependency _singletonM03D07di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); + _rootM03D07di = this; + _lockM03D07di = new object(); } /// @@ -128,52 +128,52 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots - public Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IDependency RootM03D01di0001 + public Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IDependency RootM03D07di0001 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - _singletonM03D01di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Dependency(); - _rootM03D01di._singletonM03D01di34_Dependency = _singletonM03D01di34_Dependency; + _singletonM03D07di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Dependency(); + _rootM03D07di._singletonM03D07di34_Dependency = _singletonM03D07di34_Dependency; } } } - return _rootM03D01di._singletonM03D01di34_Dependency; + return _rootM03D07di._singletonM03D07di34_Dependency; } } - public Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IService RootM03D01di0002 + public Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IService RootM03D07di0002 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - _singletonM03D01di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Dependency(); - _rootM03D01di._singletonM03D01di34_Dependency = _singletonM03D01di34_Dependency; + _singletonM03D07di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Dependency(); + _rootM03D07di._singletonM03D07di34_Dependency = _singletonM03D07di34_Dependency; } } } - return new Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Service(_rootM03D01di._singletonM03D01di34_Dependency); + return new Pure.DI.UsageTests.BCL.ServiceCollectionScenario.Service(_rootM03D07di._singletonM03D07di34_Dependency); } } #endregion @@ -189,7 +189,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -203,7 +203,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -216,10 +216,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -240,10 +240,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -262,8 +262,8 @@ partial class Composition return "classDiagram\n" + " class Composition {\n" + - " -IDependency RootM03D01di0001\n" + - " -IService RootM03D01di0002\n" + + " -IDependency RootM03D07di0001\n" + + " -IService RootM03D07di0002\n" + " + T ResolveᐸTᐳ()\n" + " + T ResolveᐸTᐳ(object? tag)\n" + " + object Resolve(Type type)\n" + @@ -284,35 +284,35 @@ partial class Composition " <>\n" + " }\n" + " Service o-- \"Singleton\" Dependency : \"Dependency Key\" IDependency\n" + - " Composition ..> Dependency : \"Dependency Key\" IDependency RootM03D01di0001\n" + - " Composition ..> Service : IService RootM03D01di0002"; + " Composition ..> Dependency : \"Dependency Key\" IDependency RootM03D07di0001\n" + + " Composition ..> Service : IService RootM03D07di0002"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - OnNewRoot(valResolverM03D01di_0000, "RootM03D01di0001", "Dependency Key", Pure.DI.Lifetime.Singleton); - ResolverM03D01di.Value = valResolverM03D01di_0000; - var valResolverM03D01di_0001 = new ResolverM03D01di_0001(); - OnNewRoot(valResolverM03D01di_0001, "RootM03D01di0002", null, Pure.DI.Lifetime.Transient); - ResolverM03D01di.Value = valResolverM03D01di_0001; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + OnNewRoot(valResolverM03D07di_0000, "RootM03D07di0001", "Dependency Key", Pure.DI.Lifetime.Singleton); + ResolverM03D07di.Value = valResolverM03D07di_0000; + var valResolverM03D07di_0001 = new ResolverM03D07di_0001(); + OnNewRoot(valResolverM03D07di_0001, "RootM03D07di0002", null, Pure.DI.Lifetime.Transient); + ResolverM03D07di.Value = valResolverM03D07di_0001; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IDependency), valResolverM03D01di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IService), valResolverM03D01di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IDependency), valResolverM03D07di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IService), valResolverM03D07di_0001) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -325,7 +325,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IDependency Resolve(Composition composition) { @@ -337,17 +337,17 @@ partial class Composition switch (tag) { case "Dependency Key": - return composition.RootM03D01di0001; + return composition.RootM03D07di0001; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IDependency."); } } - private sealed class ResolverM03D01di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IService Resolve(Composition composition) { - return composition.RootM03D01di0002; + return composition.RootM03D07di0002; } public Pure.DI.UsageTests.BCL.ServiceCollectionScenario.IService ResolveByTag(Composition composition, object tag) @@ -355,7 +355,7 @@ partial class Composition switch (tag) { case null: - return composition.RootM03D01di0002; + return composition.RootM03D07di0002; } 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 9d3f7be6..c0964d41 100644 --- a/readme/service-provider-with-scope.md +++ b/readme/service-provider-with-scope.md @@ -20,7 +20,7 @@ class Service(IDependency dependency) : IService } partial class Composition - : IServiceProvider, IKeyedServiceProvider, IServiceScopeFactory, IServiceScope + : IKeyedServiceProvider, IServiceScopeFactory, IServiceScope { private void Setup() => // The following hint overrides the name of the @@ -73,8 +73,8 @@ dependency1.ShouldBe(dependency2); ```mermaid classDiagram class Composition { - -IDependency RootM03D01di0001 - -IService RootM03D01di0002 + -IDependency RootM03D07di0001 + -IService RootM03D07di0002 + 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 RootM03D01di0001 - Composition ..> Service : IService RootM03D01di0002 + Composition ..> Dependency : IDependency RootM03D07di0001 + Composition ..> Service : IService RootM03D07di0002 ``` @@ -134,28 +134,28 @@ classDiagram /// /// /// -/// 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 _rootM03D01di; - private readonly object _lockM03D01di; - private readonly global::System.IDisposable[] _disposablesM03D01di; - private int _disposeIndexM03D01di; - private Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Dependency _singletonM03D01di34_Dependency; - private Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Service _scopedM03D01di35_Service; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; + private readonly global::System.IDisposable[] _disposablesM03D07di; + private int _disposeIndexM03D07di; + private Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Dependency _singletonM03D07di34_Dependency; + private Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Service _scopedM03D07di35_Service; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); - _disposablesM03D01di = new global::System.IDisposable[1]; + _rootM03D07di = this; + _lockM03D07di = new object(); + _disposablesM03D07di = new global::System.IDisposable[1]; } /// @@ -164,58 +164,58 @@ partial class Composition: global::System.IDisposable /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; - _disposablesM03D01di = new global::System.IDisposable[1]; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; + _disposablesM03D07di = new global::System.IDisposable[1]; } #region Composition Roots - public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency RootM03D01di0001 + public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency RootM03D07di0001 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - _singletonM03D01di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Dependency(); - _rootM03D01di._singletonM03D01di34_Dependency = _singletonM03D01di34_Dependency; + _singletonM03D07di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Dependency(); + _rootM03D07di._singletonM03D07di34_Dependency = _singletonM03D07di34_Dependency; } } } - return _rootM03D01di._singletonM03D01di34_Dependency; + return _rootM03D07di._singletonM03D07di34_Dependency; } } - public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IService RootM03D01di0002 + public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IService RootM03D07di0002 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_scopedM03D01di35_Service, null)) + if (ReferenceEquals(_scopedM03D07di35_Service, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_scopedM03D01di35_Service, null)) + if (ReferenceEquals(_scopedM03D07di35_Service, null)) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - _singletonM03D01di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Dependency(); - _rootM03D01di._singletonM03D01di34_Dependency = _singletonM03D01di34_Dependency; + _singletonM03D07di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Dependency(); + _rootM03D07di._singletonM03D07di34_Dependency = _singletonM03D07di34_Dependency; } - _scopedM03D01di35_Service = new Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Service(_rootM03D01di._singletonM03D01di34_Dependency); - _disposablesM03D01di[_disposeIndexM03D01di++] = _scopedM03D01di35_Service; + _scopedM03D07di35_Service = new Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.Service(_rootM03D07di._singletonM03D07di34_Dependency); + _disposablesM03D07di[_disposeIndexM03D07di++] = _scopedM03D07di35_Service; } } } - return _scopedM03D01di35_Service; + return _scopedM03D07di35_Service; } } #endregion @@ -231,7 +231,7 @@ partial class Composition: global::System.IDisposable #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -245,7 +245,7 @@ partial class Composition: global::System.IDisposable #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -258,10 +258,10 @@ partial class Composition: global::System.IDisposable #endif public object GetService(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -282,10 +282,10 @@ partial class Composition: global::System.IDisposable #endif public object GetRequiredKeyedService(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -302,11 +302,11 @@ partial class Composition: global::System.IDisposable /// public void Dispose() { - lock (_lockM03D01di) + lock (_lockM03D07di) { - while (_disposeIndexM03D01di > 0) + while (_disposeIndexM03D07di > 0) { - var disposableInstance = _disposablesM03D01di[--_disposeIndexM03D01di]; + var disposableInstance = _disposablesM03D07di[--_disposeIndexM03D07di]; try { disposableInstance.Dispose(); @@ -317,8 +317,8 @@ partial class Composition: global::System.IDisposable } } - _singletonM03D01di34_Dependency = null; - _scopedM03D01di35_Service = null; + _singletonM03D07di34_Dependency = null; + _scopedM03D07di35_Service = null; } } @@ -332,8 +332,8 @@ partial class Composition: global::System.IDisposable return "classDiagram\n" + " class Composition {\n" + - " -IDependency RootM03D01di0001\n" + - " -IService RootM03D01di0002\n" + + " -IDependency RootM03D07di0001\n" + + " -IService RootM03D07di0002\n" + " + T ResolveᐸTᐳ()\n" + " + T ResolveᐸTᐳ(object? tag)\n" + " + object GetService(Type type)\n" + @@ -355,33 +355,33 @@ partial class Composition: global::System.IDisposable " <>\n" + " }\n" + " Service o-- \"Singleton\" Dependency : IDependency\n" + - " Composition ..> Dependency : IDependency RootM03D01di0001\n" + - " Composition ..> Service : IService RootM03D01di0002"; + " Composition ..> Dependency : IDependency RootM03D07di0001\n" + + " Composition ..> Service : IService RootM03D07di0002"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - var valResolverM03D01di_0001 = new ResolverM03D01di_0001(); - ResolverM03D01di.Value = valResolverM03D01di_0001; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + var valResolverM03D07di_0001 = new ResolverM03D07di_0001(); + ResolverM03D07di.Value = valResolverM03D07di_0001; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency), valResolverM03D01di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IService), valResolverM03D01di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency), valResolverM03D07di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IService), valResolverM03D07di_0001) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -394,11 +394,11 @@ partial class Composition: global::System.IDisposable } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency Resolve(Composition composition) { - return composition.RootM03D01di0001; + return composition.RootM03D07di0001; } public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency ResolveByTag(Composition composition, object tag) @@ -406,17 +406,17 @@ partial class Composition: global::System.IDisposable switch (tag) { case null: - return composition.RootM03D01di0001; + return composition.RootM03D07di0001; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IDependency."); } } - private sealed class ResolverM03D01di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IService Resolve(Composition composition) { - return composition.RootM03D01di0002; + return composition.RootM03D07di0002; } public Pure.DI.UsageTests.BCL.ServiceProviderWithScopeScenario.IService ResolveByTag(Composition composition, object tag) @@ -424,7 +424,7 @@ partial class Composition: global::System.IDisposable switch (tag) { case null: - return composition.RootM03D01di0002; + return composition.RootM03D07di0002; } 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 c60c7717..1066cf84 100644 --- a/readme/service-provider.md +++ b/readme/service-provider.md @@ -45,8 +45,8 @@ service.Dependency.ShouldBe(dependency); ```mermaid classDiagram class Composition { - -IDependency RootM03D01di0001 - -IService RootM03D01di0002 + -IDependency RootM03D07di0001 + -IService RootM03D07di0002 + 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 RootM03D01di0001 - Composition ..> Service : IService RootM03D01di0002 + Composition ..> Dependency : IDependency RootM03D07di0001 + Composition ..> Service : IService RootM03D07di0002 ``` @@ -100,24 +100,24 @@ classDiagram /// /// /// -/// 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 _rootM03D01di; - private readonly object _lockM03D01di; - private Pure.DI.UsageTests.BCL.ServiceProviderScenario.Dependency _singletonM03D01di34_Dependency; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; + private Pure.DI.UsageTests.BCL.ServiceProviderScenario.Dependency _singletonM03D07di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); + _rootM03D07di = this; + _lockM03D07di = new object(); } /// @@ -126,52 +126,52 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots - public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency RootM03D01di0001 + public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency RootM03D07di0001 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - _singletonM03D01di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderScenario.Dependency(); - _rootM03D01di._singletonM03D01di34_Dependency = _singletonM03D01di34_Dependency; + _singletonM03D07di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderScenario.Dependency(); + _rootM03D07di._singletonM03D07di34_Dependency = _singletonM03D07di34_Dependency; } } } - return _rootM03D01di._singletonM03D01di34_Dependency; + return _rootM03D07di._singletonM03D07di34_Dependency; } } - public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService RootM03D01di0002 + public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService RootM03D07di0002 { #if NETSTANDARD2_0_OR_GREATER || NETCOREAPP || NET40_OR_GREATER || NET [global::System.Diagnostics.Contracts.Pure] #endif get { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - _singletonM03D01di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderScenario.Dependency(); - _rootM03D01di._singletonM03D01di34_Dependency = _singletonM03D01di34_Dependency; + _singletonM03D07di34_Dependency = new Pure.DI.UsageTests.BCL.ServiceProviderScenario.Dependency(); + _rootM03D07di._singletonM03D07di34_Dependency = _singletonM03D07di34_Dependency; } } } - return new Pure.DI.UsageTests.BCL.ServiceProviderScenario.Service(_rootM03D01di._singletonM03D01di34_Dependency); + return new Pure.DI.UsageTests.BCL.ServiceProviderScenario.Service(_rootM03D07di._singletonM03D07di34_Dependency); } } #endregion @@ -187,7 +187,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -201,7 +201,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -214,10 +214,10 @@ partial class Composition #endif public object GetService(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -238,10 +238,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -260,8 +260,8 @@ partial class Composition return "classDiagram\n" + " class Composition {\n" + - " -IDependency RootM03D01di0001\n" + - " -IService RootM03D01di0002\n" + + " -IDependency RootM03D07di0001\n" + + " -IService RootM03D07di0002\n" + " + T ResolveᐸTᐳ()\n" + " + T ResolveᐸTᐳ(object? tag)\n" + " + object GetService(Type type)\n" + @@ -282,33 +282,33 @@ partial class Composition " <>\n" + " }\n" + " Service o-- \"Singleton\" Dependency : IDependency\n" + - " Composition ..> Dependency : IDependency RootM03D01di0001\n" + - " Composition ..> Service : IService RootM03D01di0002"; + " Composition ..> Dependency : IDependency RootM03D07di0001\n" + + " Composition ..> Service : IService RootM03D07di0002"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - var valResolverM03D01di_0001 = new ResolverM03D01di_0001(); - ResolverM03D01di.Value = valResolverM03D01di_0001; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + var valResolverM03D07di_0001 = new ResolverM03D07di_0001(); + ResolverM03D07di.Value = valResolverM03D07di_0001; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency), valResolverM03D01di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService), valResolverM03D01di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency), valResolverM03D07di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService), valResolverM03D07di_0001) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -321,11 +321,11 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency Resolve(Composition composition) { - return composition.RootM03D01di0001; + return composition.RootM03D07di0001; } public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency ResolveByTag(Composition composition, object tag) @@ -333,17 +333,17 @@ partial class Composition switch (tag) { case null: - return composition.RootM03D01di0001; + return composition.RootM03D07di0001; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceProviderScenario.IDependency."); } } - private sealed class ResolverM03D01di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0001: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService Resolve(Composition composition) { - return composition.RootM03D01di0002; + return composition.RootM03D07di0002; } public Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService ResolveByTag(Composition composition, object tag) @@ -351,7 +351,7 @@ partial class Composition switch (tag) { case null: - return composition.RootM03D01di0002; + return composition.RootM03D07di0002; } throw new global::System.InvalidOperationException($"Cannot resolve composition root \"{tag}\" of type Pure.DI.UsageTests.BCL.ServiceProviderScenario.IService."); } diff --git a/readme/singleton.md b/readme/singleton.md index 7d923eb5..eafb98d5 100644 --- a/readme/singleton.md +++ b/readme/singleton.md @@ -104,17 +104,17 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; - private readonly object _lockM03D01di; - private Pure.DI.UsageTests.Lifetimes.SingletonScenario.Dependency _singletonM03D01di34_Dependency; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; + private Pure.DI.UsageTests.Lifetimes.SingletonScenario.Dependency _singletonM03D07di34_Dependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); + _rootM03D07di = this; + _lockM03D07di = new object(); } /// @@ -123,8 +123,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots @@ -135,18 +135,18 @@ partial class Composition #endif get { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di34_Dependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di34_Dependency, null)) { - _singletonM03D01di34_Dependency = new Pure.DI.UsageTests.Lifetimes.SingletonScenario.Dependency(); - _rootM03D01di._singletonM03D01di34_Dependency = _singletonM03D01di34_Dependency; + _singletonM03D07di34_Dependency = new Pure.DI.UsageTests.Lifetimes.SingletonScenario.Dependency(); + _rootM03D07di._singletonM03D07di34_Dependency = _singletonM03D07di34_Dependency; } } } - return new Pure.DI.UsageTests.Lifetimes.SingletonScenario.Service(_singletonM03D01di34_Dependency, _rootM03D01di._singletonM03D01di34_Dependency); + return new Pure.DI.UsageTests.Lifetimes.SingletonScenario.Service(_singletonM03D07di34_Dependency, _rootM03D07di._singletonM03D07di34_Dependency); } } #endregion @@ -162,7 +162,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -176,7 +176,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -189,10 +189,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -213,10 +213,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -260,26 +260,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.SingletonScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.SingletonScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -292,7 +292,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 6103364b..5a3b554d 100644 --- a/readme/span-and-readonlyspan.md +++ b/readme/span-and-readonlyspan.md @@ -106,14 +106,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -122,7 +122,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -133,13 +133,13 @@ partial class Composition #endif get { - System.ReadOnlySpan transientM03D01di1_ReadOnlySpan = stackalloc Pure.DI.UsageTests.BCL.SpanScenario.Dependency[3] + System.ReadOnlySpan transientM03D07di1_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(transientM03D01di1_ReadOnlySpan); + return new Pure.DI.UsageTests.BCL.SpanScenario.Service(transientM03D07di1_ReadOnlySpan); } } #endregion @@ -155,7 +155,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -169,7 +169,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -182,10 +182,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -206,10 +206,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -252,26 +252,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.SpanScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.SpanScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -284,7 +284,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 8a221c4b..aac3629f 100644 --- a/readme/tag-attribute.md +++ b/readme/tag-attribute.md @@ -114,14 +114,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -130,7 +130,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -157,7 +157,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -171,7 +171,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -184,10 +184,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -208,10 +208,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -259,26 +259,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagAttributeScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagAttributeScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -291,7 +291,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.TagAttributeScenario.IService Resolve(Composition composition) { diff --git a/readme/tags.md b/readme/tags.md index e8491570..d44a4515 100644 --- a/readme/tags.md +++ b/readme/tags.md @@ -137,17 +137,17 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; - private readonly object _lockM03D01di; - private Pure.DI.UsageTests.Basics.TagsScenario.XyzDependency _singletonM03D01di35_XyzDependency; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; + private Pure.DI.UsageTests.Basics.TagsScenario.XyzDependency _singletonM03D07di35_XyzDependency; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); + _rootM03D07di = this; + _lockM03D07di = new object(); } /// @@ -156,8 +156,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots @@ -171,18 +171,18 @@ partial class Composition #endif get { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di35_XyzDependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di35_XyzDependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di35_XyzDependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di35_XyzDependency, null)) { - _singletonM03D01di35_XyzDependency = new Pure.DI.UsageTests.Basics.TagsScenario.XyzDependency(); - _rootM03D01di._singletonM03D01di35_XyzDependency = _singletonM03D01di35_XyzDependency; + _singletonM03D07di35_XyzDependency = new Pure.DI.UsageTests.Basics.TagsScenario.XyzDependency(); + _rootM03D07di._singletonM03D07di35_XyzDependency = _singletonM03D07di35_XyzDependency; } } } - return _rootM03D01di._singletonM03D01di35_XyzDependency; + return _rootM03D07di._singletonM03D07di35_XyzDependency; } } @@ -193,18 +193,18 @@ partial class Composition #endif get { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di35_XyzDependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di35_XyzDependency, null)) { - lock (_lockM03D01di) + lock (_lockM03D07di) { - if (ReferenceEquals(_rootM03D01di._singletonM03D01di35_XyzDependency, null)) + if (ReferenceEquals(_rootM03D07di._singletonM03D07di35_XyzDependency, null)) { - _singletonM03D01di35_XyzDependency = new Pure.DI.UsageTests.Basics.TagsScenario.XyzDependency(); - _rootM03D01di._singletonM03D01di35_XyzDependency = _singletonM03D01di35_XyzDependency; + _singletonM03D07di35_XyzDependency = new Pure.DI.UsageTests.Basics.TagsScenario.XyzDependency(); + _rootM03D07di._singletonM03D07di35_XyzDependency = _singletonM03D07di35_XyzDependency; } } } - return new Pure.DI.UsageTests.Basics.TagsScenario.Service(new Pure.DI.UsageTests.Basics.TagsScenario.AbcDependency(), _rootM03D01di._singletonM03D01di35_XyzDependency, new Pure.DI.UsageTests.Basics.TagsScenario.AbcDependency()); + return new Pure.DI.UsageTests.Basics.TagsScenario.Service(new Pure.DI.UsageTests.Basics.TagsScenario.AbcDependency(), _rootM03D07di._singletonM03D07di35_XyzDependency, new Pure.DI.UsageTests.Basics.TagsScenario.AbcDependency()); } } #endregion @@ -220,7 +220,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -234,7 +234,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -247,10 +247,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -271,10 +271,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 4)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -326,29 +326,29 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - var valResolverM03D01di_0001 = new ResolverM03D01di_0001(); - ResolverM03D01di.Value = valResolverM03D01di_0001; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + var valResolverM03D07di_0001 = new ResolverM03D07di_0001(); + ResolverM03D07di.Value = valResolverM03D07di_0001; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 4, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[2] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagsScenario.IDependency), valResolverM03D01di_0000) - ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagsScenario.IService), valResolverM03D01di_0001) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagsScenario.IDependency), valResolverM03D07di_0000) + ,new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TagsScenario.IService), valResolverM03D07di_0001) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -361,7 +361,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.Basics.TagsScenario.IDependency Resolve(Composition composition) { @@ -379,7 +379,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0001: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 626b7f6d..c600f99c 100644 --- a/readme/task.md +++ b/readme/task.md @@ -135,16 +135,16 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; - private readonly object _lockM03D01di; + private readonly Composition _rootM03D07di; + private readonly object _lockM03D07di; /// /// This parameterized constructor creates a new instance of with arguments. /// public Composition() { - _rootM03D01di = this; - _lockM03D01di = new object(); + _rootM03D07di = this; + _lockM03D07di = new object(); } /// @@ -153,8 +153,8 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; - _lockM03D01di = _rootM03D01di._lockM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; + _lockM03D07di = _rootM03D07di._lockM03D07di; } #region Composition Roots @@ -163,32 +163,32 @@ partial class Composition #endif public Pure.DI.UsageTests.BCL.TaskScenario.IService GetRoot(System.Threading.CancellationToken cancellationToken) { - var perResolveM03D01di39_Func = default(System.Func); - System.Threading.Tasks.TaskScheduler transientM03D01di5_TaskScheduler = TaskScheduler.Current; - System.Threading.Tasks.TaskContinuationOptions transientM03D01di4_TaskContinuationOptions = global::System.Threading.Tasks.TaskContinuationOptions.None; - System.Threading.Tasks.TaskCreationOptions transientM03D01di3_TaskCreationOptions = global::System.Threading.Tasks.TaskCreationOptions.None; - System.Threading.Tasks.TaskFactory perBlockM03D01di2_TaskFactory; + var perResolveM03D07di39_Func = default(System.Func); + System.Threading.Tasks.TaskScheduler transientM03D07di5_TaskScheduler = TaskScheduler.Current; + System.Threading.Tasks.TaskContinuationOptions transientM03D07di4_TaskContinuationOptions = global::System.Threading.Tasks.TaskContinuationOptions.None; + System.Threading.Tasks.TaskCreationOptions transientM03D07di3_TaskCreationOptions = global::System.Threading.Tasks.TaskCreationOptions.None; + System.Threading.Tasks.TaskFactory perBlockM03D07di2_TaskFactory; { - var cancellationToken_M03D01di1 = cancellationToken; - var taskCreationOptions_M03D01di2 = transientM03D01di3_TaskCreationOptions; - var taskContinuationOptions_M03D01di3 = transientM03D01di4_TaskContinuationOptions; - var taskScheduler_M03D01di4 = transientM03D01di5_TaskScheduler; - perBlockM03D01di2_TaskFactory = new global::System.Threading.Tasks.TaskFactory(cancellationToken_M03D01di1, taskCreationOptions_M03D01di2, taskContinuationOptions_M03D01di3, taskScheduler_M03D01di4); + var cancellationToken_M03D07di1 = cancellationToken; + var taskCreationOptions_M03D07di2 = transientM03D07di3_TaskCreationOptions; + var taskContinuationOptions_M03D07di3 = transientM03D07di4_TaskContinuationOptions; + var taskScheduler_M03D07di4 = transientM03D07di5_TaskScheduler; + perBlockM03D07di2_TaskFactory = new global::System.Threading.Tasks.TaskFactory(cancellationToken_M03D07di1, taskCreationOptions_M03D07di2, taskContinuationOptions_M03D07di3, taskScheduler_M03D07di4); } - perResolveM03D01di39_Func = new global::System.Func( + perResolveM03D07di39_Func = new global::System.Func( [global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)] () => { - var factory_M03D01di5 = new Pure.DI.UsageTests.BCL.TaskScenario.Dependency(); - return factory_M03D01di5; + var factory_M03D07di5 = new Pure.DI.UsageTests.BCL.TaskScenario.Dependency(); + return factory_M03D07di5; }); - System.Threading.Tasks.Task transientM03D01di1_Task; + System.Threading.Tasks.Task transientM03D07di1_Task; { - var factory_M03D01di6 = perResolveM03D01di39_Func; - var taskFactory_M03D01di7 = perBlockM03D01di2_TaskFactory; - transientM03D01di1_Task = taskFactory_M03D01di7.StartNew(factory_M03D01di6); + var factory_M03D07di6 = perResolveM03D07di39_Func; + var taskFactory_M03D07di7 = perBlockM03D07di2_TaskFactory; + transientM03D07di1_Task = taskFactory_M03D07di7.StartNew(factory_M03D07di6); } - return new Pure.DI.UsageTests.BCL.TaskScenario.Service(transientM03D01di1_Task); + return new Pure.DI.UsageTests.BCL.TaskScenario.Service(transientM03D07di1_Task); } #endregion diff --git a/readme/threadsafe-hint.md b/readme/threadsafe-hint.md index 12d25d64..05353c1b 100644 --- a/readme/threadsafe-hint.md +++ b/readme/threadsafe-hint.md @@ -93,14 +93,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -109,7 +109,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -136,7 +136,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -150,7 +150,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -163,10 +163,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -187,10 +187,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -233,26 +233,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.ThreadSafeHintScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.ThreadSafeHintScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -265,7 +265,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 8cd2a3e3..2d9d236c 100644 --- a/readme/tostring-hint.md +++ b/readme/tostring-hint.md @@ -91,14 +91,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -107,7 +107,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -134,7 +134,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -148,7 +148,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -161,10 +161,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -185,10 +185,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -231,26 +231,26 @@ partial class Composition " Composition ..> Service : IService MyService"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.ToStringHintScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Hints.ToStringHintScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -263,7 +263,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 09924540..b3b00e3c 100644 --- a/readme/tracking-disposable-instances.md +++ b/readme/tracking-disposable-instances.md @@ -8,7 +8,7 @@ interface IDependency bool IsDisposed { get; } } -class TransientDependency : IDependency, IDisposable +class Dependency : IDependency, IDisposable { public bool IsDisposed { get; private set; } @@ -42,7 +42,7 @@ partial class Composition Hint.OnNewInstanceLifetimeRegularExpression, "Transient|PerResolve|PerBlock") - .Bind().To() + .Bind().To() .Bind().To() .Root("Root"); @@ -92,9 +92,9 @@ classDiagram + object Resolve(Type type) + object Resolve(Type type, object? tag) } - TransientDependency --|> IDependency : - class TransientDependency { - +TransientDependency() + Dependency --|> IDependency : + class Dependency { + +Dependency() } Service --|> IService : class Service { @@ -106,7 +106,7 @@ classDiagram class IService { <> } - Service *-- TransientDependency : IDependency + Service *-- Dependency : IDependency Composition ..> Service : IService Root ``` @@ -139,21 +139,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 _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -162,7 +162,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -173,11 +173,11 @@ partial class Composition #endif get { - var transientM03D01di1_TransientDependency = new Pure.DI.UsageTests.Basics.TrackingDisposableInstancesScenario.TransientDependency(); - OnNewInstance(ref transientM03D01di1_TransientDependency, null, Pure.DI.Lifetime.Transient); - var transientM03D01di0_Service = new Pure.DI.UsageTests.Basics.TrackingDisposableInstancesScenario.Service(transientM03D01di1_TransientDependency); - OnNewInstance(ref transientM03D01di0_Service, null, Pure.DI.Lifetime.Transient); - return transientM03D01di0_Service; + var transientM03D07di1_Dependency = new Pure.DI.UsageTests.Basics.TrackingDisposableInstancesScenario.Dependency(); + OnNewInstance(ref transientM03D07di1_Dependency, null, Pure.DI.Lifetime.Transient); + var transientM03D07di0_Service = new Pure.DI.UsageTests.Basics.TrackingDisposableInstancesScenario.Service(transientM03D07di1_Dependency); + OnNewInstance(ref transientM03D07di0_Service, null, Pure.DI.Lifetime.Transient); + return transientM03D07di0_Service; } } #endregion @@ -193,7 +193,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -207,7 +207,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -220,10 +220,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -244,10 +244,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -274,9 +274,9 @@ partial class Composition " + object Resolve(Type type)\n" + " + object Resolve(Type type, object? tag)\n" + " }\n" + - " TransientDependency --|> IDependency : \n" + - " class TransientDependency {\n" + - " +TransientDependency()\n" + + " Dependency --|> IDependency : \n" + + " class Dependency {\n" + + " +Dependency()\n" + " }\n" + " Service --|> IService : \n" + " class Service {\n" + @@ -288,30 +288,30 @@ partial class Composition " class IService {\n" + " <>\n" + " }\n" + - " Service *-- TransientDependency : IDependency\n" + + " Service *-- Dependency : IDependency\n" + " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TrackingDisposableInstancesScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Basics.TrackingDisposableInstancesScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -324,7 +324,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 b0ec11fa..10beecb1 100644 --- a/readme/transient.md +++ b/readme/transient.md @@ -104,14 +104,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -120,7 +120,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -147,7 +147,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -161,7 +161,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -174,10 +174,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -198,10 +198,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -245,26 +245,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.TransientScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Lifetimes.TransientScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -277,7 +277,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 0eee54e4..f9fe14cf 100644 --- a/readme/tuple.md +++ b/readme/tuple.md @@ -102,14 +102,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -118,7 +118,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -129,8 +129,8 @@ partial class Composition #endif get { - Pure.DI.UsageTests.BCL.TupleScenario.Point transientM03D01di2_Point = new Point(7, 9); - return new Pure.DI.UsageTests.BCL.TupleScenario.Service((transientM03D01di2_Point, new Pure.DI.UsageTests.BCL.TupleScenario.Dependency())); + Pure.DI.UsageTests.BCL.TupleScenario.Point transientM03D07di2_Point = new Point(7, 9); + return new Pure.DI.UsageTests.BCL.TupleScenario.Service((transientM03D07di2_Point, new Pure.DI.UsageTests.BCL.TupleScenario.Dependency())); } } #endregion @@ -146,7 +146,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -160,7 +160,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -173,10 +173,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -197,10 +197,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -249,26 +249,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.TupleScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.TupleScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -281,7 +281,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 c0e3d5c9..c452233d 100644 --- a/readme/type-attribute.md +++ b/readme/type-attribute.md @@ -105,14 +105,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -121,7 +121,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -148,7 +148,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -162,7 +162,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -175,10 +175,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -199,10 +199,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -245,26 +245,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.TypeAttributeScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.Attributes.TypeAttributeScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -277,7 +277,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 fbed7ce4..ca05ec2b 100644 --- a/readme/valuetask.md +++ b/readme/valuetask.md @@ -104,14 +104,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -120,7 +120,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -131,12 +131,12 @@ partial class Composition #endif get { - System.Threading.Tasks.ValueTask transientM03D01di1_ValueTask; + System.Threading.Tasks.ValueTask transientM03D07di1_ValueTask; { - var value_M03D01di1 = new Pure.DI.UsageTests.BCL.ValueTaskScenario.Dependency(); - transientM03D01di1_ValueTask = new global::System.Threading.Tasks.ValueTask(value_M03D01di1); + var value_M03D07di1 = new Pure.DI.UsageTests.BCL.ValueTaskScenario.Dependency(); + transientM03D07di1_ValueTask = new global::System.Threading.Tasks.ValueTask(value_M03D07di1); } - return new Pure.DI.UsageTests.BCL.ValueTaskScenario.Service(transientM03D01di1_ValueTask); + return new Pure.DI.UsageTests.BCL.ValueTaskScenario.Service(transientM03D07di1_ValueTask); } } #endregion @@ -152,7 +152,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -166,7 +166,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -179,10 +179,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -203,10 +203,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -251,26 +251,26 @@ partial class Composition " ValueTaskᐸIDependencyᐳ *-- Dependency : IDependency"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ValueTaskScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.ValueTaskScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -283,7 +283,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_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 a86ab932..fd56e319 100644 --- a/readme/weak-reference.md +++ b/readme/weak-reference.md @@ -95,14 +95,14 @@ classDiagram [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] partial class Composition { - private readonly Composition _rootM03D01di; + private readonly Composition _rootM03D07di; /// /// This constructor creates a new instance of . /// public Composition() { - _rootM03D01di = this; + _rootM03D07di = this; } /// @@ -111,7 +111,7 @@ partial class Composition /// Base composition. internal Composition(Composition baseComposition) { - _rootM03D01di = baseComposition._rootM03D01di; + _rootM03D07di = baseComposition._rootM03D07di; } #region Composition Roots @@ -138,7 +138,7 @@ partial class Composition #endif public T Resolve() { - return ResolverM03D01di.Value.Resolve(this); + return ResolverM03D07di.Value.Resolve(this); } /// @@ -152,7 +152,7 @@ partial class Composition #endif public T Resolve(object? tag) { - return ResolverM03D01di.Value.ResolveByTag(this, tag); + return ResolverM03D07di.Value.ResolveByTag(this, tag); } /// @@ -165,10 +165,10 @@ partial class Composition #endif public object Resolve(global::System.Type type) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.Resolve(this); @@ -189,10 +189,10 @@ partial class Composition #endif public object Resolve(global::System.Type type, object? tag) { - var index = (int)(_bucketSizeM03D01di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); - var finish = index + _bucketSizeM03D01di; + var index = (int)(_bucketSizeM03D07di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1)); + var finish = index + _bucketSizeM03D07di; do { - ref var pair = ref _bucketsM03D01di[index]; + ref var pair = ref _bucketsM03D07di[index]; if (ReferenceEquals(pair.Key, type)) { return pair.Value.ResolveByTag(this, tag); @@ -239,26 +239,26 @@ partial class Composition " Composition ..> Service : IService Root"; } - private readonly static int _bucketSizeM03D01di; - private readonly static global::Pure.DI.Pair>[] _bucketsM03D01di; + private readonly static int _bucketSizeM03D07di; + private readonly static global::Pure.DI.Pair>[] _bucketsM03D07di; static Composition() { - var valResolverM03D01di_0000 = new ResolverM03D01di_0000(); - ResolverM03D01di.Value = valResolverM03D01di_0000; - _bucketsM03D01di = global::Pure.DI.Buckets>.Create( + var valResolverM03D07di_0000 = new ResolverM03D07di_0000(); + ResolverM03D07di.Value = valResolverM03D07di_0000; + _bucketsM03D07di = global::Pure.DI.Buckets>.Create( 1, - out _bucketSizeM03D01di, + out _bucketSizeM03D07di, new global::Pure.DI.Pair>[1] { - new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.WeakReferenceScenario.IService), valResolverM03D01di_0000) + new global::Pure.DI.Pair>(typeof(Pure.DI.UsageTests.BCL.WeakReferenceScenario.IService), valResolverM03D07di_0000) }); } #region Resolvers - private sealed class ResolverM03D01di: global::Pure.DI.IResolver + private sealed class ResolverM03D07di: global::Pure.DI.IResolver { - public static global::Pure.DI.IResolver Value = new ResolverM03D01di(); + public static global::Pure.DI.IResolver Value = new ResolverM03D07di(); public T Resolve(Composition composite) { @@ -271,7 +271,7 @@ partial class Composition } } - private sealed class ResolverM03D01di_0000: global::Pure.DI.IResolver + private sealed class ResolverM03D07di_0000: global::Pure.DI.IResolver { public Pure.DI.UsageTests.BCL.WeakReferenceScenario.IService Resolve(Composition composition) {