Skip to content

Commit 373b0b7

Browse files
Support for the Ordinal attribute without any arguments
1 parent e733591 commit 373b0b7

14 files changed

Lines changed: 281 additions & 129 deletions

File tree

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,7 @@ DI.Setup("Composition")
17711771

17721772
```
17731773

1774-
The type of dependency to be bound. Common type markers such as _TT_, _TTList`1_ and others are also supported.
1774+
The type of a dependency to be bound. Common type markers such as _TT_, _TTList`1_ and others are also supported.
17751775
- parameter _tags_ - The optional argument that specifies tags for a particular type of dependency binding.
17761776

17771777
- returns Reference to the setup continuation chain.
@@ -1794,7 +1794,7 @@ See also _As(Pure.DI.Lifetime)_.
17941794
<details><summary>Method Bind``2(System.Object[])</summary><blockquote>
17951795

17961796
Begins binding definition for multiple dependencies. See _Bind``1(System.Object[])_ for examples.
1797-
The type 1 of dependency to be bound.The type 2 of dependency to be bound.
1797+
Type 1 of a dependency to be bound.Type 2 of a dependency to be bound.
17981798
- parameter _tags_ - The optional argument that specifies tags for a particular type of dependency binding.
17991799

18001800
- returns Reference to the setup continuation chain.
@@ -1817,7 +1817,7 @@ See also _As(Pure.DI.Lifetime)_.
18171817
<details><summary>Method Bind``3(System.Object[])</summary><blockquote>
18181818

18191819
Begins binding definition for multiple dependencies. See _Bind``1(System.Object[])_ for examples.
1820-
The type 1 of dependency to be bound.The type 2 of dependency to be bound.The type 3 of dependency to be bound.
1820+
Type 1 of a dependency to be bound.Type 2 of a dependency to be bound.Type 3 of a dependency to be bound.
18211821
- parameter _tags_ - The optional argument that specifies tags for a particular type of dependency binding.
18221822

18231823
- returns Reference to the setup continuation chain.
@@ -1840,7 +1840,7 @@ See also _As(Pure.DI.Lifetime)_.
18401840
<details><summary>Method Bind``4(System.Object[])</summary><blockquote>
18411841

18421842
Begins binding definition for multiple dependencies. See _Bind``1(System.Object[])_ for examples.
1843-
The type 1 of dependency to be bound.The type 2 of dependency to be bound.The type 3 of dependency to be bound.The type 3 of dependency to be bound.
1843+
Type 1 of a dependency to be bound.Type 2 of a dependency to be bound.Type 3 of a dependency to be bound.Type 3 of a dependency to be bound.
18441844
- parameter _tags_ - The optional argument that specifies tags for a particular type of dependency binding.
18451845

18461846
- returns Reference to the setup continuation chain.
@@ -2265,7 +2265,7 @@ DI.Setup("Composition")
22652265

22662266
```
22672267

2268-
The type of dependency to be bound.
2268+
The type of a dependency to be bound.
22692269
- parameter _tags_ - The optional argument that specifies tags for a particular type of dependency binding.
22702270

22712271
- returns Reference to the setup continuation chain.
@@ -2288,7 +2288,7 @@ See also _As(Pure.DI.Lifetime)_.
22882288
<details><summary>Method Bind``2(System.Object[])</summary><blockquote>
22892289

22902290
Begins binding definition for multiple dependencies. See _Bind``1(System.Object[])_ for examples.
2291-
The type 1 of dependency to be bound.The type 2 of dependency to be bound.
2291+
Type 1 of a dependency to be bound.Type 2 of a dependency to be bound.
22922292
- parameter _tags_ - The optional argument that specifies tags for a particular type of dependency binding.
22932293

22942294
- returns Reference to the setup continuation chain.
@@ -2311,7 +2311,7 @@ See also _As(Pure.DI.Lifetime)_.
23112311
<details><summary>Method Bind``3(System.Object[])</summary><blockquote>
23122312

23132313
Begins binding definition for multiple dependencies. See _Bind``1(System.Object[])_ for examples.
2314-
The type 1 of dependency to be bound.The type 2 of dependency to be bound.The type 3 of dependency to be bound.
2314+
Type 1 of a dependency to be bound.Type 2 of a dependency to be bound.Type 3 of a dependency to be bound.
23152315
- parameter _tags_ - The optional argument that specifies tags for a particular type of dependency binding.
23162316

23172317
- returns Reference to the setup continuation chain.
@@ -2334,7 +2334,7 @@ See also _As(Pure.DI.Lifetime)_.
23342334
<details><summary>Method Bind``4(System.Object[])</summary><blockquote>
23352335

23362336
Begins binding definition for multiple dependencies. See _Bind``1(System.Object[])_ for examples.
2337-
The type 1 of dependency to be bound.The type 2 of dependency to be bound.The type 3 of dependency to be bound.The type 4 of dependency to be bound.
2337+
Type 1 of a dependency to be bound.Type 2 of a dependency to be bound.Type 3 of a dependency to be bound.Type 4 of a dependency to be bound.
23382338
- parameter _tags_ - The optional argument that specifies tags for a particular type of dependency binding.
23392339

23402340
- returns Reference to the setup continuation chain.
@@ -2365,7 +2365,7 @@ DI.Setup("Composition")
23652365

23662366
```
23672367

2368-
The type of dependency to be bound.
2368+
The type of a dependency to be bound.
23692369
- parameter _name_ - Specifies the name of the root of the composition. If the value is empty, a private root will be created, which can be used when calling `Resolve` methods.
23702370
The name supports templating:
23712371
TemplateDescription{type}Will be replaced by the short name of the root type without its namespaces.{TYPE}Will be replaced with the full name of the root type.{tag}Will be replaced with the first tag name.

benchmarks/Pure.DI.Benchmarks/Pure.DI.Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<ProjectReference Include="..\..\src\Pure.DI\Pure.DI.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
1818
<PackageReference Include="BenchmarkDotNet" Version="0.14.0"/>
1919
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.14.0"/>
20-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.4" />
20+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
2121
<PackageReference Include="IoC.Container" Version="1.3.8"/>
2222
<PackageReference Include="Moq" Version="4.20.72"/>
2323
<PackageReference Include="SimpleInjector" Version="5.5.0"/>

samples/AvaloniaApp/Composition.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ private void Setup() => DI.Setup()
1313
.Root<IAppViewModel>(nameof(App), kind: Virtual)
1414
.Root<IClockViewModel>(nameof(Clock), kind: Virtual)
1515

16-
.OrdinalAttribute<InitializableAttribute>()
17-
1816
.Bind().As(Singleton).To<ClockViewModel>()
1917
.Bind().To<ClockModel>()
2018
.Bind().As(Singleton).To<Ticks>()

samples/BlazorWebAssemblyApp/BlazorWebAssemblyApp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<ItemGroup>
99
<ProjectReference Include="..\..\src\Pure.DI.Core\Pure.DI.Core.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
1010
<ProjectReference Include="..\..\src\Pure.DI\Pure.DI.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
11-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.4" />
12-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.4" PrivateAssets="all" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.5" />
12+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.5" PrivateAssets="all" />
1313
<ProjectReference Include="..\Clock\Clock.csproj"/>
1414
<Compile Include="..\..\src\Pure.DI.MS\any\Pure.DI\MS\*.cs" Link=""/>
1515
</ItemGroup>

samples/Clock/ClockViewModel.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ public string Date
3838
private set => _date = OnPropertyChanged(value);
3939
}
4040

41-
[Initializable]
42-
public void OnTick()
41+
private void OnTick()
4342
{
4443
_now = _clockModel.Now;
4544
_log.Info($"Updating by {_now}");

samples/Clock/InitializableAttribute.cs

Lines changed: 0 additions & 5 deletions
This file was deleted.

samples/WebAPI/WebAPI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ItemGroup>
88
<ProjectReference Include="..\..\src\Pure.DI.Core\Pure.DI.Core.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
99
<ProjectReference Include="..\..\src\Pure.DI\Pure.DI.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
10-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.4"/>
10+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.5" />
1111
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.1"/>
1212
<ProjectReference Include="..\Clock\Clock.csproj"/>
1313
<Compile Include="..\..\src\Pure.DI.MS\any\Pure.DI\MS\*.cs" Link=""/>

0 commit comments

Comments
 (0)