Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Mar 28, 2024
1 parent a40ddc1 commit bfe5e8e
Show file tree
Hide file tree
Showing 92 changed files with 2,207 additions and 2,133 deletions.
42 changes: 21 additions & 21 deletions readme/ArrayDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ classDiagram
```c#
partial class Array
{
private readonly Array _rootM03D27di;
private readonly Array _rootM03D28di;

public Array()
{
_rootM03D27di = this;
_rootM03D28di = this;
}

internal Array(Array baseComposition)
{
_rootM03D27di = baseComposition._rootM03D27di;
_rootM03D28di = baseComposition._rootM03D28di;
}

public partial Pure.DI.Benchmarks.Model.CompositionRoot PureDIByCR()
Expand All @@ -107,20 +107,20 @@ partial class Array

public T Resolve<T>()
{
return ResolverM03D27di<T>.Value.Resolve(this);
return ResolverM03D28di<T>.Value.Resolve(this);
}

public T Resolve<T>(object? tag)
{
return ResolverM03D27di<T>.Value.ResolveByTag(this, tag);
return ResolverM03D28di<T>.Value.ResolveByTag(this, tag);
}

public object Resolve(global::System.Type type)
{
var index = (int)(_bucketSizeM03D27di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D27di;
var index = (int)(_bucketSizeM03D28di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D28di;
do {
ref var pair = ref _bucketsM03D27di[index];
ref var pair = ref _bucketsM03D28di[index];
if (ReferenceEquals(pair.Key, type))
{
return pair.Value.Resolve(this);
Expand All @@ -132,10 +132,10 @@ partial class Array

public object Resolve(global::System.Type type, object? tag)
{
var index = (int)(_bucketSizeM03D27di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D27di;
var index = (int)(_bucketSizeM03D28di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D28di;
do {
ref var pair = ref _bucketsM03D27di[index];
ref var pair = ref _bucketsM03D28di[index];
if (ReferenceEquals(pair.Key, type))
{
return pair.Value.ResolveByTag(this, tag);
Expand Down Expand Up @@ -224,25 +224,25 @@ partial class Array
" Array ..> CompositionRoot : CompositionRoot PureDIByCR()";
}

private readonly static int _bucketSizeM03D27di;
private readonly static global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Array, object>>[] _bucketsM03D27di;
private readonly static int _bucketSizeM03D28di;
private readonly static global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Array, object>>[] _bucketsM03D28di;

static Array()
{
var valResolverM03D27di_0000 = new ResolverM03D27di_0000();
ResolverM03D27di<Pure.DI.Benchmarks.Model.CompositionRoot>.Value = valResolverM03D27di_0000;
_bucketsM03D27di = global::Pure.DI.Buckets<global::System.Type, global::Pure.DI.IResolver<Array, object>>.Create(
var valResolverM03D28di_0000 = new ResolverM03D28di_0000();
ResolverM03D28di<Pure.DI.Benchmarks.Model.CompositionRoot>.Value = valResolverM03D28di_0000;
_bucketsM03D28di = global::Pure.DI.Buckets<global::System.Type, global::Pure.DI.IResolver<Array, object>>.Create(
1,
out _bucketSizeM03D27di,
out _bucketSizeM03D28di,
new global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Array, object>>[1]
{
new global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Array, object>>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D27di_0000)
new global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Array, object>>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D28di_0000)
});
}

private sealed class ResolverM03D27di<T>: global::Pure.DI.IResolver<Array, T>
private sealed class ResolverM03D28di<T>: global::Pure.DI.IResolver<Array, T>
{
public static global::Pure.DI.IResolver<Array, T> Value = new ResolverM03D27di<T>();
public static global::Pure.DI.IResolver<Array, T> Value = new ResolverM03D28di<T>();

public T Resolve(Array composite)
{
Expand All @@ -255,7 +255,7 @@ partial class Array
}
}

private sealed class ResolverM03D27di_0000: global::Pure.DI.IResolver<Array, Pure.DI.Benchmarks.Model.CompositionRoot>
private sealed class ResolverM03D28di_0000: global::Pure.DI.IResolver<Array, Pure.DI.Benchmarks.Model.CompositionRoot>
{
public Pure.DI.Benchmarks.Model.CompositionRoot Resolve(Array composition)
{
Expand Down
2 changes: 1 addition & 1 deletion readme/Avalonia.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The definition of the composition is in [Composition.cs](/samples/AvaloniaApp/Co
```csharp
internal partial class Composition
{
private static void Setup() => DI.Setup(nameof(Composition))
void Setup() => DI.Setup(nameof(Composition))
// Provides the composition root for main window
.Root<MainWindow>("MainWindow")
// Provides the composition root for Clock view model
Expand Down
2 changes: 1 addition & 1 deletion readme/BlazorServerApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Composition setup file is [Composition.cs](/samples/BlazorServerApp/Composition.
```c#
internal partial class Composition: ServiceProviderFactory<Composition>
{
private static void Setup() =>
void Setup() =>
DI.Setup(nameof(Composition))
.DependsOn(Base)
// Specifies not to attempt to resolve types whose fully qualified name
Expand Down
2 changes: 1 addition & 1 deletion readme/BlazorWebAssemblyApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Composition setup file is [Composition.cs](/samples/BlazorWebAssemblyApp/Composi
```c#
internal partial class Composition: ServiceProviderFactory<Composition>
{
private static void Setup() =>
void Setup() =>
DI.Setup(nameof(Composition))
.DependsOn(Base)
// Specifies not to attempt to resolve types whose fully qualified name
Expand Down
2 changes: 1 addition & 1 deletion readme/Console.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ internal partial class Composition
// In fact, this code is never run, and the method can have any name or be a constructor, for example,
// and can be in any part of the compiled code because this is just a hint to set up an object graph.
// Here the setup is part of the generated class, just as an example.
private static void Setup() =>
void Setup() =>
DI.Setup(nameof(Composition))
// Models a random subatomic event that may or may not occur
.Bind().As(Singleton).To<Random>()
Expand Down
48 changes: 24 additions & 24 deletions readme/EnumDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,48 +88,48 @@ classDiagram
```c#
partial class Enum
{
private readonly Enum _rootM03D27di;
private readonly Enum _rootM03D28di;

public Enum()
{
_rootM03D27di = this;
_rootM03D28di = this;
}

internal Enum(Enum baseComposition)
{
_rootM03D27di = baseComposition._rootM03D27di;
_rootM03D28di = baseComposition._rootM03D28di;
}

public partial Pure.DI.Benchmarks.Model.CompositionRoot PureDIByCR()
{
[global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)0x200)]
System.Collections.Generic.IEnumerable<Pure.DI.Benchmarks.Model.IService3> LocalperBlockM03D27di10_IEnumerable()
System.Collections.Generic.IEnumerable<Pure.DI.Benchmarks.Model.IService3> LocalperBlockM03D28di10_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());
}
System.Collections.Generic.IEnumerable<Pure.DI.Benchmarks.Model.IService3> perBlockM03D27di10_IEnumerable = LocalperBlockM03D27di10_IEnumerable();
return new Pure.DI.Benchmarks.Model.CompositionRoot(new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D27di10_IEnumerable)), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D27di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D27di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D27di10_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());
System.Collections.Generic.IEnumerable<Pure.DI.Benchmarks.Model.IService3> perBlockM03D28di10_IEnumerable = LocalperBlockM03D28di10_IEnumerable();
return new Pure.DI.Benchmarks.Model.CompositionRoot(new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D28di10_IEnumerable)), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D28di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D28di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D28di10_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());
}

public T Resolve<T>()
{
return ResolverM03D27di<T>.Value.Resolve(this);
return ResolverM03D28di<T>.Value.Resolve(this);
}

public T Resolve<T>(object? tag)
{
return ResolverM03D27di<T>.Value.ResolveByTag(this, tag);
return ResolverM03D28di<T>.Value.ResolveByTag(this, tag);
}

public object Resolve(global::System.Type type)
{
var index = (int)(_bucketSizeM03D27di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D27di;
var index = (int)(_bucketSizeM03D28di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D28di;
do {
ref var pair = ref _bucketsM03D27di[index];
ref var pair = ref _bucketsM03D28di[index];
if (ReferenceEquals(pair.Key, type))
{
return pair.Value.Resolve(this);
Expand All @@ -141,10 +141,10 @@ partial class Enum

public object Resolve(global::System.Type type, object? tag)
{
var index = (int)(_bucketSizeM03D27di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D27di;
var index = (int)(_bucketSizeM03D28di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D28di;
do {
ref var pair = ref _bucketsM03D27di[index];
ref var pair = ref _bucketsM03D28di[index];
if (ReferenceEquals(pair.Key, type))
{
return pair.Value.ResolveByTag(this, tag);
Expand Down Expand Up @@ -233,25 +233,25 @@ partial class Enum
" Enum ..> CompositionRoot : CompositionRoot PureDIByCR()";
}

private readonly static int _bucketSizeM03D27di;
private readonly static global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Enum, object>>[] _bucketsM03D27di;
private readonly static int _bucketSizeM03D28di;
private readonly static global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Enum, object>>[] _bucketsM03D28di;

static Enum()
{
var valResolverM03D27di_0000 = new ResolverM03D27di_0000();
ResolverM03D27di<Pure.DI.Benchmarks.Model.CompositionRoot>.Value = valResolverM03D27di_0000;
_bucketsM03D27di = global::Pure.DI.Buckets<global::System.Type, global::Pure.DI.IResolver<Enum, object>>.Create(
var valResolverM03D28di_0000 = new ResolverM03D28di_0000();
ResolverM03D28di<Pure.DI.Benchmarks.Model.CompositionRoot>.Value = valResolverM03D28di_0000;
_bucketsM03D28di = global::Pure.DI.Buckets<global::System.Type, global::Pure.DI.IResolver<Enum, object>>.Create(
1,
out _bucketSizeM03D27di,
out _bucketSizeM03D28di,
new global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Enum, object>>[1]
{
new global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Enum, object>>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D27di_0000)
new global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Enum, object>>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D28di_0000)
});
}

private sealed class ResolverM03D27di<T>: global::Pure.DI.IResolver<Enum, T>
private sealed class ResolverM03D28di<T>: global::Pure.DI.IResolver<Enum, T>
{
public static global::Pure.DI.IResolver<Enum, T> Value = new ResolverM03D27di<T>();
public static global::Pure.DI.IResolver<Enum, T> Value = new ResolverM03D28di<T>();

public T Resolve(Enum composite)
{
Expand All @@ -264,7 +264,7 @@ partial class Enum
}
}

private sealed class ResolverM03D27di_0000: global::Pure.DI.IResolver<Enum, Pure.DI.Benchmarks.Model.CompositionRoot>
private sealed class ResolverM03D28di_0000: global::Pure.DI.IResolver<Enum, Pure.DI.Benchmarks.Model.CompositionRoot>
{
public Pure.DI.Benchmarks.Model.CompositionRoot Resolve(Enum composition)
{
Expand Down
50 changes: 25 additions & 25 deletions readme/FuncDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,46 +67,46 @@ classDiagram
```c#
partial class Func
{
private readonly Func _rootM03D27di;
private readonly Func _rootM03D28di;

public Func()
{
_rootM03D27di = this;
_rootM03D28di = this;
}

internal Func(Func baseComposition)
{
_rootM03D27di = baseComposition._rootM03D27di;
_rootM03D28di = baseComposition._rootM03D28di;
}

public partial Pure.DI.Benchmarks.Model.CompositionRoot PureDIByCR()
{
System.Func<Pure.DI.Benchmarks.Model.IService3> perBlockM03D27di10_Func = new Func<Pure.DI.Benchmarks.Model.IService3>(
System.Func<Pure.DI.Benchmarks.Model.IService3> perBlockM03D28di10_Func = new Func<Pure.DI.Benchmarks.Model.IService3>(
[global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)]
() =>
{
var value_M03D27di1 = new Pure.DI.Benchmarks.Model.Service3(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4());
return value_M03D27di1;
var value_M03D28di1 = new Pure.DI.Benchmarks.Model.Service3(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4());
return value_M03D28di1;
});
return new Pure.DI.Benchmarks.Model.CompositionRoot(new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D27di10_Func)), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D27di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D27di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D27di10_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(perBlockM03D28di10_Func)), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D28di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D28di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D28di10_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());
}

public T Resolve<T>()
{
return ResolverM03D27di<T>.Value.Resolve(this);
return ResolverM03D28di<T>.Value.Resolve(this);
}

public T Resolve<T>(object? tag)
{
return ResolverM03D27di<T>.Value.ResolveByTag(this, tag);
return ResolverM03D28di<T>.Value.ResolveByTag(this, tag);
}

public object Resolve(global::System.Type type)
{
var index = (int)(_bucketSizeM03D27di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D27di;
var index = (int)(_bucketSizeM03D28di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D28di;
do {
ref var pair = ref _bucketsM03D27di[index];
ref var pair = ref _bucketsM03D28di[index];
if (ReferenceEquals(pair.Key, type))
{
return pair.Value.Resolve(this);
Expand All @@ -118,10 +118,10 @@ partial class Func

public object Resolve(global::System.Type type, object? tag)
{
var index = (int)(_bucketSizeM03D27di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D27di;
var index = (int)(_bucketSizeM03D28di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D28di;
do {
ref var pair = ref _bucketsM03D27di[index];
ref var pair = ref _bucketsM03D28di[index];
if (ReferenceEquals(pair.Key, type))
{
return pair.Value.ResolveByTag(this, tag);
Expand Down Expand Up @@ -189,25 +189,25 @@ partial class Func
" FuncᐸIService3ᐳ *-- Service3 : IService3";
}

private readonly static int _bucketSizeM03D27di;
private readonly static global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Func, object>>[] _bucketsM03D27di;
private readonly static int _bucketSizeM03D28di;
private readonly static global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Func, object>>[] _bucketsM03D28di;

static Func()
{
var valResolverM03D27di_0000 = new ResolverM03D27di_0000();
ResolverM03D27di<Pure.DI.Benchmarks.Model.CompositionRoot>.Value = valResolverM03D27di_0000;
_bucketsM03D27di = global::Pure.DI.Buckets<global::System.Type, global::Pure.DI.IResolver<Func, object>>.Create(
var valResolverM03D28di_0000 = new ResolverM03D28di_0000();
ResolverM03D28di<Pure.DI.Benchmarks.Model.CompositionRoot>.Value = valResolverM03D28di_0000;
_bucketsM03D28di = global::Pure.DI.Buckets<global::System.Type, global::Pure.DI.IResolver<Func, object>>.Create(
1,
out _bucketSizeM03D27di,
out _bucketSizeM03D28di,
new global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Func, object>>[1]
{
new global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Func, object>>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D27di_0000)
new global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Func, object>>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D28di_0000)
});
}

private sealed class ResolverM03D27di<T>: global::Pure.DI.IResolver<Func, T>
private sealed class ResolverM03D28di<T>: global::Pure.DI.IResolver<Func, T>
{
public static global::Pure.DI.IResolver<Func, T> Value = new ResolverM03D27di<T>();
public static global::Pure.DI.IResolver<Func, T> Value = new ResolverM03D28di<T>();

public T Resolve(Func composite)
{
Expand All @@ -220,7 +220,7 @@ partial class Func
}
}

private sealed class ResolverM03D27di_0000: global::Pure.DI.IResolver<Func, Pure.DI.Benchmarks.Model.CompositionRoot>
private sealed class ResolverM03D28di_0000: global::Pure.DI.IResolver<Func, Pure.DI.Benchmarks.Model.CompositionRoot>
{
public Pure.DI.Benchmarks.Model.CompositionRoot Resolve(Func composition)
{
Expand Down
2 changes: 1 addition & 1 deletion readme/GrpcService.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Composition setup file is [Composition.cs](/samples/GrpcService/Composition.cs):
```c#
internal partial class Composition: ServiceProviderFactory<Composition>
{
private static void Setup() =>
void Setup() =>
DI.Setup(nameof(Composition))
.DependsOn(Base)
// Specifies not to attempt to resolve types whose fully qualified name
Expand Down
Loading

0 comments on commit bfe5e8e

Please sign in to comment.