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 14, 2024
1 parent c69c43a commit 1a3212e
Show file tree
Hide file tree
Showing 75 changed files with 2,336 additions and 2,008 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ dotnet run
- [Factory](readme/factory.md)
- [Injection](readme/injection.md)
- [Generic composition roots](readme/generic-composition-roots.md)
- [Generic with constraints composition roots](readme/generic-with-constraints-composition-roots.md)
- [Generics](readme/generics.md)
- [Arguments](readme/arguments.md)
- [Root arguments](readme/root-arguments.md)
Expand Down
42 changes: 21 additions & 21 deletions readme/ArrayDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ classDiagram
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class Array
{
private readonly Array _rootM03D13di;
private readonly Array _rootM03D14di;

/// <summary>
/// This constructor creates a new instance of <see cref="Array"/>.
/// </summary>
public Array()
{
_rootM03D13di = this;
_rootM03D14di = this;
}

/// <summary>
Expand All @@ -135,7 +135,7 @@ partial class Array
/// <param name="baseComposition">Base composition.</param>
internal Array(Array baseComposition)
{
_rootM03D13di = baseComposition._rootM03D13di;
_rootM03D14di = baseComposition._rootM03D14di;
}

#region Composition Roots
Expand Down Expand Up @@ -169,7 +169,7 @@ partial class Array
#endif
public T Resolve<T>()
{
return ResolverM03D13di<T>.Value.Resolve(this);
return ResolverM03D14di<T>.Value.Resolve(this);
}

/// <summary>
Expand All @@ -183,7 +183,7 @@ partial class Array
#endif
public T Resolve<T>(object? tag)
{
return ResolverM03D13di<T>.Value.ResolveByTag(this, tag);
return ResolverM03D14di<T>.Value.ResolveByTag(this, tag);
}

/// <summary>
Expand All @@ -196,10 +196,10 @@ partial class Array
#endif
public object Resolve(global::System.Type type)
{
var index = (int)(_bucketSizeM03D13di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D13di;
var index = (int)(_bucketSizeM03D14di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D14di;
do {
ref var pair = ref _bucketsM03D13di[index];
ref var pair = ref _bucketsM03D14di[index];
if (ReferenceEquals(pair.Key, type))
{
return pair.Value.Resolve(this);
Expand All @@ -220,10 +220,10 @@ partial class Array
#endif
public object Resolve(global::System.Type type, object? tag)
{
var index = (int)(_bucketSizeM03D13di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D13di;
var index = (int)(_bucketSizeM03D14di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D14di;
do {
ref var pair = ref _bucketsM03D13di[index];
ref var pair = ref _bucketsM03D14di[index];
if (ReferenceEquals(pair.Key, type))
{
return pair.Value.ResolveByTag(this, tag);
Expand Down Expand Up @@ -316,26 +316,26 @@ partial class Array
" Array ..> CompositionRoot : CompositionRoot PureDIByCR()<br/>provides CompositionRoot";
}

private readonly static int _bucketSizeM03D13di;
private readonly static global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Array, object>>[] _bucketsM03D13di;
private readonly static int _bucketSizeM03D14di;
private readonly static global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Array, object>>[] _bucketsM03D14di;

static Array()
{
var valResolverM03D13di_0000 = new ResolverM03D13di_0000();
ResolverM03D13di<Pure.DI.Benchmarks.Model.CompositionRoot>.Value = valResolverM03D13di_0000;
_bucketsM03D13di = global::Pure.DI.Buckets<global::System.Type, global::Pure.DI.IResolver<Array, object>>.Create(
var valResolverM03D14di_0000 = new ResolverM03D14di_0000();
ResolverM03D14di<Pure.DI.Benchmarks.Model.CompositionRoot>.Value = valResolverM03D14di_0000;
_bucketsM03D14di = global::Pure.DI.Buckets<global::System.Type, global::Pure.DI.IResolver<Array, object>>.Create(
1,
out _bucketSizeM03D13di,
out _bucketSizeM03D14di,
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), valResolverM03D13di_0000)
new global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Array, object>>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D14di_0000)
});
}

#region Resolvers
private sealed class ResolverM03D13di<T>: global::Pure.DI.IResolver<Array, T>
private sealed class ResolverM03D14di<T>: global::Pure.DI.IResolver<Array, T>
{
public static global::Pure.DI.IResolver<Array, T> Value = new ResolverM03D13di<T>();
public static global::Pure.DI.IResolver<Array, T> Value = new ResolverM03D14di<T>();

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

private sealed class ResolverM03D13di_0000: global::Pure.DI.IResolver<Array, Pure.DI.Benchmarks.Model.CompositionRoot>
private sealed class ResolverM03D14di_0000: global::Pure.DI.IResolver<Array, Pure.DI.Benchmarks.Model.CompositionRoot>
{
public Pure.DI.Benchmarks.Model.CompositionRoot Resolve(Array composition)
{
Expand Down
48 changes: 24 additions & 24 deletions readme/EnumDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ classDiagram
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class Enum
{
private readonly Enum _rootM03D13di;
private readonly Enum _rootM03D14di;

/// <summary>
/// This constructor creates a new instance of <see cref="Enum"/>.
/// </summary>
public Enum()
{
_rootM03D13di = this;
_rootM03D14di = this;
}

/// <summary>
Expand All @@ -135,7 +135,7 @@ partial class Enum
/// <param name="baseComposition">Base composition.</param>
internal Enum(Enum baseComposition)
{
_rootM03D13di = baseComposition._rootM03D13di;
_rootM03D14di = baseComposition._rootM03D14di;
}

#region Composition Roots
Expand All @@ -155,15 +155,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<Pure.DI.Benchmarks.Model.IService3> LocalperBlockM03D13di10_IEnumerable()
System.Collections.Generic.IEnumerable<Pure.DI.Benchmarks.Model.IService3> LocalperBlockM03D14di10_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 perBlockM03D13di10_IEnumerable = LocalperBlockM03D13di10_IEnumerable();
return new Pure.DI.Benchmarks.Model.CompositionRoot(new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D13di10_IEnumerable)), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D13di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D13di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D13di10_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 perBlockM03D14di10_IEnumerable = LocalperBlockM03D14di10_IEnumerable();
return new Pure.DI.Benchmarks.Model.CompositionRoot(new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D14di10_IEnumerable)), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D14di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D14di10_IEnumerable), new Pure.DI.Benchmarks.Model.Service2Enum(perBlockM03D14di10_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

Expand All @@ -178,7 +178,7 @@ partial class Enum
#endif
public T Resolve<T>()
{
return ResolverM03D13di<T>.Value.Resolve(this);
return ResolverM03D14di<T>.Value.Resolve(this);
}

/// <summary>
Expand All @@ -192,7 +192,7 @@ partial class Enum
#endif
public T Resolve<T>(object? tag)
{
return ResolverM03D13di<T>.Value.ResolveByTag(this, tag);
return ResolverM03D14di<T>.Value.ResolveByTag(this, tag);
}

/// <summary>
Expand All @@ -205,10 +205,10 @@ partial class Enum
#endif
public object Resolve(global::System.Type type)
{
var index = (int)(_bucketSizeM03D13di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D13di;
var index = (int)(_bucketSizeM03D14di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D14di;
do {
ref var pair = ref _bucketsM03D13di[index];
ref var pair = ref _bucketsM03D14di[index];
if (ReferenceEquals(pair.Key, type))
{
return pair.Value.Resolve(this);
Expand All @@ -229,10 +229,10 @@ partial class Enum
#endif
public object Resolve(global::System.Type type, object? tag)
{
var index = (int)(_bucketSizeM03D13di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D13di;
var index = (int)(_bucketSizeM03D14di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D14di;
do {
ref var pair = ref _bucketsM03D13di[index];
ref var pair = ref _bucketsM03D14di[index];
if (ReferenceEquals(pair.Key, type))
{
return pair.Value.ResolveByTag(this, tag);
Expand Down Expand Up @@ -325,26 +325,26 @@ partial class Enum
" Enum ..> CompositionRoot : CompositionRoot PureDIByCR()<br/>provides CompositionRoot";
}

private readonly static int _bucketSizeM03D13di;
private readonly static global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Enum, object>>[] _bucketsM03D13di;
private readonly static int _bucketSizeM03D14di;
private readonly static global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Enum, object>>[] _bucketsM03D14di;

static Enum()
{
var valResolverM03D13di_0000 = new ResolverM03D13di_0000();
ResolverM03D13di<Pure.DI.Benchmarks.Model.CompositionRoot>.Value = valResolverM03D13di_0000;
_bucketsM03D13di = global::Pure.DI.Buckets<global::System.Type, global::Pure.DI.IResolver<Enum, object>>.Create(
var valResolverM03D14di_0000 = new ResolverM03D14di_0000();
ResolverM03D14di<Pure.DI.Benchmarks.Model.CompositionRoot>.Value = valResolverM03D14di_0000;
_bucketsM03D14di = global::Pure.DI.Buckets<global::System.Type, global::Pure.DI.IResolver<Enum, object>>.Create(
1,
out _bucketSizeM03D13di,
out _bucketSizeM03D14di,
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), valResolverM03D13di_0000)
new global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Enum, object>>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D14di_0000)
});
}

#region Resolvers
private sealed class ResolverM03D13di<T>: global::Pure.DI.IResolver<Enum, T>
private sealed class ResolverM03D14di<T>: global::Pure.DI.IResolver<Enum, T>
{
public static global::Pure.DI.IResolver<Enum, T> Value = new ResolverM03D13di<T>();
public static global::Pure.DI.IResolver<Enum, T> Value = new ResolverM03D14di<T>();

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

private sealed class ResolverM03D13di_0000: global::Pure.DI.IResolver<Enum, Pure.DI.Benchmarks.Model.CompositionRoot>
private sealed class ResolverM03D14di_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 @@ -98,14 +98,14 @@ classDiagram
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
partial class Func
{
private readonly Func _rootM03D13di;
private readonly Func _rootM03D14di;

/// <summary>
/// This constructor creates a new instance of <see cref="Func"/>.
/// </summary>
public Func()
{
_rootM03D13di = this;
_rootM03D14di = this;
}

/// <summary>
Expand All @@ -114,7 +114,7 @@ partial class Func
/// <param name="baseComposition">Base composition.</param>
internal Func(Func baseComposition)
{
_rootM03D13di = baseComposition._rootM03D13di;
_rootM03D14di = baseComposition._rootM03D14di;
}

#region Composition Roots
Expand All @@ -133,14 +133,14 @@ partial class Func
#endif
public partial Pure.DI.Benchmarks.Model.CompositionRoot PureDIByCR()
{
System.Func<Pure.DI.Benchmarks.Model.IService3> perBlockM03D13di10_Func = new Func<Pure.DI.Benchmarks.Model.IService3>(
System.Func<Pure.DI.Benchmarks.Model.IService3> perBlockM03D14di10_Func = new Func<Pure.DI.Benchmarks.Model.IService3>(
[global::System.Runtime.CompilerServices.MethodImpl((global::System.Runtime.CompilerServices.MethodImplOptions)768)]
() =>
{
var value_M03D13di1 = new Pure.DI.Benchmarks.Model.Service3(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4());
return value_M03D13di1;
var value_M03D14di1 = new Pure.DI.Benchmarks.Model.Service3(new Pure.DI.Benchmarks.Model.Service4(), new Pure.DI.Benchmarks.Model.Service4());
return value_M03D14di1;
});
return new Pure.DI.Benchmarks.Model.CompositionRoot(new Pure.DI.Benchmarks.Model.Service1(new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D13di10_Func)), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D13di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D13di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D13di10_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(perBlockM03D14di10_Func)), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D14di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D14di10_Func), new Pure.DI.Benchmarks.Model.Service2Func(perBlockM03D14di10_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

Expand All @@ -155,7 +155,7 @@ partial class Func
#endif
public T Resolve<T>()
{
return ResolverM03D13di<T>.Value.Resolve(this);
return ResolverM03D14di<T>.Value.Resolve(this);
}

/// <summary>
Expand All @@ -169,7 +169,7 @@ partial class Func
#endif
public T Resolve<T>(object? tag)
{
return ResolverM03D13di<T>.Value.ResolveByTag(this, tag);
return ResolverM03D14di<T>.Value.ResolveByTag(this, tag);
}

/// <summary>
Expand All @@ -182,10 +182,10 @@ partial class Func
#endif
public object Resolve(global::System.Type type)
{
var index = (int)(_bucketSizeM03D13di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D13di;
var index = (int)(_bucketSizeM03D14di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D14di;
do {
ref var pair = ref _bucketsM03D13di[index];
ref var pair = ref _bucketsM03D14di[index];
if (ReferenceEquals(pair.Key, type))
{
return pair.Value.Resolve(this);
Expand All @@ -206,10 +206,10 @@ partial class Func
#endif
public object Resolve(global::System.Type type, object? tag)
{
var index = (int)(_bucketSizeM03D13di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D13di;
var index = (int)(_bucketSizeM03D14di * ((uint)global::System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(type) % 1));
var finish = index + _bucketSizeM03D14di;
do {
ref var pair = ref _bucketsM03D13di[index];
ref var pair = ref _bucketsM03D14di[index];
if (ReferenceEquals(pair.Key, type))
{
return pair.Value.ResolveByTag(this, tag);
Expand Down Expand Up @@ -281,26 +281,26 @@ partial class Func
" FuncᐸIService3ᐳ *-- Service3 : IService3";
}

private readonly static int _bucketSizeM03D13di;
private readonly static global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Func, object>>[] _bucketsM03D13di;
private readonly static int _bucketSizeM03D14di;
private readonly static global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Func, object>>[] _bucketsM03D14di;

static Func()
{
var valResolverM03D13di_0000 = new ResolverM03D13di_0000();
ResolverM03D13di<Pure.DI.Benchmarks.Model.CompositionRoot>.Value = valResolverM03D13di_0000;
_bucketsM03D13di = global::Pure.DI.Buckets<global::System.Type, global::Pure.DI.IResolver<Func, object>>.Create(
var valResolverM03D14di_0000 = new ResolverM03D14di_0000();
ResolverM03D14di<Pure.DI.Benchmarks.Model.CompositionRoot>.Value = valResolverM03D14di_0000;
_bucketsM03D14di = global::Pure.DI.Buckets<global::System.Type, global::Pure.DI.IResolver<Func, object>>.Create(
1,
out _bucketSizeM03D13di,
out _bucketSizeM03D14di,
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), valResolverM03D13di_0000)
new global::Pure.DI.Pair<global::System.Type, global::Pure.DI.IResolver<Func, object>>(typeof(Pure.DI.Benchmarks.Model.CompositionRoot), valResolverM03D14di_0000)
});
}

#region Resolvers
private sealed class ResolverM03D13di<T>: global::Pure.DI.IResolver<Func, T>
private sealed class ResolverM03D14di<T>: global::Pure.DI.IResolver<Func, T>
{
public static global::Pure.DI.IResolver<Func, T> Value = new ResolverM03D13di<T>();
public static global::Pure.DI.IResolver<Func, T> Value = new ResolverM03D14di<T>();

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

private sealed class ResolverM03D13di_0000: global::Pure.DI.IResolver<Func, Pure.DI.Benchmarks.Model.CompositionRoot>
private sealed class ResolverM03D14di_0000: global::Pure.DI.IResolver<Func, Pure.DI.Benchmarks.Model.CompositionRoot>
{
public Pure.DI.Benchmarks.Model.CompositionRoot Resolve(Func composition)
{
Expand Down
Loading

0 comments on commit 1a3212e

Please sign in to comment.