Skip to content

Commit

Permalink
Updating internal Pure.DI to 2.1.34
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Aug 28, 2024
1 parent 9df0cec commit 6e2a50e
Show file tree
Hide file tree
Showing 34 changed files with 192 additions and 341 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<InternalVersion>2.1.33</InternalVersion>
<InternalVersion>2.1.34</InternalVersion>
<BasePackageId>Pure.DI</BasePackageId>
<LangVersion>latest</LangVersion>
<BaseTargetFramework>net8.0</BaseTargetFramework>
Expand Down
2 changes: 1 addition & 1 deletion readme/Avalonia.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ The [project file](/samples/AvaloniaApp/AvaloniaApp.csproj) looks like this:
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.33">
<PackageReference Include="Pure.DI" Version="2.1.34">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion readme/BlazorServerApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The [project file](/samples/BlazorServerApp/BlazorServerApp.csproj) looks like t
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.33">
<PackageReference Include="Pure.DI" Version="2.1.34">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion readme/BlazorWebAssemblyApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The [project file](/samples/BlazorWebAssemblyApp/BlazorWebAssemblyApp.csproj) lo
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.33">
<PackageReference Include="Pure.DI" Version="2.1.34">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion readme/Console.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The [project file](/samples/ShroedingersCat/ShroedingersCat.csproj) looks like t
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.33">
<PackageReference Include="Pure.DI" Version="2.1.34">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion readme/ConsoleNativeAOT.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The [project file](/samples/ShroedingersCatNativeAOT/ShroedingersCatNativeAOT.cs
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.33">
<PackageReference Include="Pure.DI" Version="2.1.34">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion readme/ConsoleTopLevelStatements.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The [project file](/samples/ShroedingersCatTopLevelStatements/ShroedingersCatTop
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.33">
<PackageReference Include="Pure.DI" Version="2.1.34">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
3 changes: 2 additions & 1 deletion readme/FuncDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ partial class Func
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public partial CompositionRoot TestPureDIByCR()
{
Func<IService3> perBlockFunc10 = new Func<IService3>(
var perBlockFunc10 = default(Func<IService3>);
perBlockFunc10 = new Func<IService3>(
[MethodImpl(MethodImplOptions.AggressiveInlining)]
() =>
{
Expand Down
2 changes: 1 addition & 1 deletion readme/GrpcService.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The [project file](/samples/GrpcService/GrpcService.csproj) looks like this:
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.33">
<PackageReference Include="Pure.DI" Version="2.1.34">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion readme/Maui.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ The [project file](/samples/MAUIApp/MAUIApp.csproj) looks like this:
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)"/>
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)"/>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0"/>
<PackageReference Include="Pure.DI" Version="2.1.33">
<PackageReference Include="Pure.DI" Version="2.1.34">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion readme/MinimalWebAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The [project file](/samples/WebAPI/WebAPI.csproj) looks like this:
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.33">
<PackageReference Include="Pure.DI" Version="2.1.34">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
18 changes: 9 additions & 9 deletions readme/SingletonDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ partial class Singleton
{
private readonly Singleton _root;

private Service1? _scopedService140;
private Service4? _scopedService443;
private Service1? _scopedService139;
private Service4? _scopedService442;

[OrdinalAttribute(20)]
public Singleton()
Expand All @@ -80,22 +80,22 @@ partial class Singleton
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public partial CompositionRoot TestPureDIByCR()
{
if (_scopedService443 == null)
if (_scopedService442 == null)
{
_scopedService443 = new Service4();
_scopedService442 = new Service4();
}

if (_scopedService140 == null)
if (_scopedService139 == null)
{
if (_scopedService443 == null)
if (_scopedService442 == null)
{
_scopedService443 = new Service4();
_scopedService442 = new Service4();
}

_scopedService140 = new Service1(new Service2(new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!)));
_scopedService139 = new Service1(new Service2(new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!)));
}

return new CompositionRoot(_scopedService140!, new Service2(new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!)), new Service2(new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!)), new Service2(new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!), new Service3(_scopedService443!, _scopedService443!)), new Service3(_scopedService443!, _scopedService443!), _scopedService443!, _scopedService443!);
return new CompositionRoot(_scopedService139!, new Service2(new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!)), new Service2(new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!)), new Service2(new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!), new Service3(_scopedService442!, _scopedService442!)), new Service3(_scopedService442!, _scopedService442!), _scopedService442!, _scopedService442!);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down
2 changes: 1 addition & 1 deletion readme/WebAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The [project file](/samples/WebAPI/WebAPI.csproj) looks like this:
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.33">
<PackageReference Include="Pure.DI" Version="2.1.34">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion readme/WebApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The [project file](/samples/WebApp/WebApp.csproj) looks like this:
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.33">
<PackageReference Include="Pure.DI" Version="2.1.34">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion readme/WinFormsApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The [project file](/samples/WinFormsApp/WinFormsApp.csproj) looks like this:
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.33">
<PackageReference Include="Pure.DI" Version="2.1.34">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion readme/WinFormsAppNetCore.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The [project file](/samples/WinFormsAppNetCore/WinFormsAppNetCore.csproj) looks
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.33">
<PackageReference Include="Pure.DI" Version="2.1.34">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion readme/Wpf.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The [project file](/samples/WpfAppNetCore/WpfAppNetCore.csproj) looks like this:
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.33">
<PackageReference Include="Pure.DI" Version="2.1.34">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
26 changes: 8 additions & 18 deletions readme/async-disposable-scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,24 +136,14 @@ partial class Composition: IDisposable, IAsyncDisposable
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
var perResolveFunc47 = default(Func<Session>);
if (perResolveFunc47 == null)
var perBlockFunc1 = default(Func<Session> );
perBlockFunc1 = new Func<Session>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
lock (_lock)
{
if (perResolveFunc47 == null)
{
perResolveFunc47 = new Func<Session>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
Composition transientComposition2 = this;
Session localValue63 = new Session(transientComposition2);
return localValue63;
});
}
}
}

return new Program(perResolveFunc47!);
Composition transientComposition3 = this;
Session localValue63 = new Session(transientComposition3);
return localValue63;
});
return new Program(perBlockFunc1);
}
}

Expand Down Expand Up @@ -267,7 +257,7 @@ classDiagram
<<interface>>
}
Session *-- Composition : Composition
Program o-- "PerResolve" FuncᐸSessionᐳ : FuncᐸSessionᐳ
Program o-- "PerBlock" FuncᐸSessionᐳ : FuncᐸSessionᐳ
Composition ..> Program : Program ProgramRoot
Composition ..> Service : IService SessionRoot
Service o-- "Scoped" Dependency : IDependency
Expand Down
45 changes: 16 additions & 29 deletions readme/async-root.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,52 +35,39 @@ The following partial class will be generated:
partial class Composition
{
private readonly Composition _root;
private readonly object _lock;

[OrdinalAttribute(10)]
public Composition()
{
_root = this;
_lock = new object();
}

internal Composition(Composition parentScope)
{
_root = (parentScope ?? throw new ArgumentNullException(nameof(parentScope)))._root;
_lock = _root._lock;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Task<IService> GetMyServiceAsync(CancellationToken cancellationToken)
{
var perResolveFunc45 = default(Func<IService>);
TaskScheduler transientTaskScheduler4 = TaskScheduler.Default;
TaskContinuationOptions transientTaskContinuationOptions3 = TaskContinuationOptions.None;
TaskCreationOptions transientTaskCreationOptions2 = TaskCreationOptions.None;
TaskFactory<IService> perBlockTaskFactory1;
TaskScheduler transientTaskScheduler5 = TaskScheduler.Default;
TaskContinuationOptions transientTaskContinuationOptions4 = TaskContinuationOptions.None;
TaskCreationOptions transientTaskCreationOptions3 = TaskCreationOptions.None;
TaskFactory<IService> perBlockTaskFactory2;
CancellationToken localCancellationToken17 = cancellationToken;
TaskCreationOptions localTaskCreationOptions18 = transientTaskCreationOptions2;
TaskContinuationOptions localTaskContinuationOptions19 = transientTaskContinuationOptions3;
TaskScheduler localTaskScheduler20 = transientTaskScheduler4;
perBlockTaskFactory1 = new TaskFactory<IService>(localCancellationToken17, localTaskCreationOptions18, localTaskContinuationOptions19, localTaskScheduler20);
if (perResolveFunc45 == null)
TaskCreationOptions localTaskCreationOptions18 = transientTaskCreationOptions3;
TaskContinuationOptions localTaskContinuationOptions19 = transientTaskContinuationOptions4;
TaskScheduler localTaskScheduler20 = transientTaskScheduler5;
perBlockTaskFactory2 = new TaskFactory<IService>(localCancellationToken17, localTaskCreationOptions18, localTaskContinuationOptions19, localTaskScheduler20);
var perBlockFunc1 = default(Func<IService> );
perBlockFunc1 = new Func<IService>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
lock (_lock)
{
if (perResolveFunc45 == null)
{
perResolveFunc45 = new Func<IService>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
IService localValue21 = new Service(new Dependency());
return localValue21;
});
}
}
}

IService localValue21 = new Service(new Dependency());
return localValue21;
});
Task<IService> transientTask0;
Func<IService> localFactory22 = perResolveFunc45!;
TaskFactory<IService> localTaskFactory23 = perBlockTaskFactory1;
Func<IService> localFactory22 = perBlockFunc1;
TaskFactory<IService> localTaskFactory23 = perBlockTaskFactory2;
transientTask0 = localTaskFactory23.StartNew(localFactory22);
return transientTask0;
}
Expand Down Expand Up @@ -122,7 +109,7 @@ classDiagram
TaskFactory *-- TaskContinuationOptions : TaskContinuationOptions
TaskFactory *-- TaskScheduler : TaskScheduler
Service *-- Dependency : IDependency
TaskᐸIServiceᐳ o-- "PerResolve" FuncᐸIServiceᐳ : FuncᐸIServiceᐳ
TaskᐸIServiceᐳ o-- "PerBlock" FuncᐸIServiceᐳ : FuncᐸIServiceᐳ
TaskᐸIServiceᐳ o-- "PerBlock" TaskFactoryᐸIServiceᐳ : TaskFactoryᐸIServiceᐳ
FuncᐸIServiceᐳ *-- Service : IService
TaskFactoryᐸIServiceᐳ o-- CancellationToken : Argument "cancellationToken"
Expand Down
36 changes: 13 additions & 23 deletions readme/auto-scoped.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,29 +95,19 @@ partial class Composition
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
var perResolveFunc46 = default(Func<IService>);
if (perResolveFunc46 == null)
var perBlockFunc1 = default(Func<IService> );
perBlockFunc1 = new Func<IService>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
lock (_lock)
{
if (perResolveFunc46 == null)
{
perResolveFunc46 = new Func<IService>([MethodImpl(MethodImplOptions.AggressiveInlining)] () =>
{
Composition transientComposition2 = this;
IService transientIService1;
Composition localBaseComposition65 = transientComposition2;
// Creates a session
var localSession66= new Composition(localBaseComposition65);
transientIService1 = localSession66.SessionRoot;
IService localValue64 = transientIService1;
return localValue64;
});
}
}
}

return new Program(perResolveFunc46!);
Composition transientComposition3 = this;
IService transientIService2;
Composition localBaseComposition65 = transientComposition3;
// Creates a session
var localSession66= new Composition(localBaseComposition65);
transientIService2 = localSession66.SessionRoot;
IService localValue64 = transientIService2;
return localValue64;
});
return new Program(perBlockFunc1);
}
}

Expand Down Expand Up @@ -169,7 +159,7 @@ classDiagram
<<interface>>
}
Service o-- "Scoped" Dependency : IDependency
Program o-- "PerResolve" FuncᐸIServiceᐳ : FuncᐸIServiceᐳ
Program o-- "PerBlock" FuncᐸIServiceᐳ : FuncᐸIServiceᐳ
Composition ..> Program : Program ProgramRoot
Composition ..> Service : Service SessionRoot
IService *-- Composition : Composition
Expand Down
3 changes: 2 additions & 1 deletion readme/func-with-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ partial class Composition
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
Func<int, int, IDependency> transientFunc1 =
var transientFunc1 = default(Func<int, int, IDependency>);
transientFunc1 =
[MethodImpl(MethodImplOptions.AggressiveInlining)]
(dependencyId, subId) =>
{
Expand Down
Loading

0 comments on commit 6e2a50e

Please sign in to comment.