Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Mar 7, 2024
1 parent e62f88e commit f2f91d2
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 26 deletions.
2 changes: 1 addition & 1 deletion readme/Avalonia.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ The [project file](/samples/AvaloniaApp/AvaloniaApp.csproj) looks like this:
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.3">
<PackageReference Include="Pure.DI" Version="2.1.4">
<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 @@ -68,7 +68,7 @@ The [project file](/samples/BlazorServerApp/BlazorServerApp.csproj) looks like t
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.3">
<PackageReference Include="Pure.DI" Version="2.1.4">
<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 @@ -65,7 +65,7 @@ The [project file](/samples/BlazorWebAssemblyApp/BlazorWebAssemblyApp.csproj) lo
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.3">
<PackageReference Include="Pure.DI" Version="2.1.4">
<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 @@ -90,7 +90,7 @@ The [project file](/samples/ShroedingersCat/ShroedingersCat.csproj) looks like t
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.3">
<PackageReference Include="Pure.DI" Version="2.1.4">
<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.3">
<PackageReference Include="Pure.DI" Version="2.1.4">
<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 @@ -78,7 +78,7 @@ The [project file](/samples/ShroedingersCatTopLevelStatements/ShroedingersCatTop
</PropertyGroup>

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

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.3">
<PackageReference Include="Pure.DI" Version="2.1.4">
<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.3">
<PackageReference Include="Pure.DI" Version="2.1.4">
<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 @@ -76,7 +76,7 @@ The [project file](/samples/WebAPI/WebAPI.csproj) looks like this:
</PropertyGroup>

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

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.3">
<PackageReference Include="Pure.DI" Version="2.1.4">
<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 @@ -51,7 +51,7 @@ The [project file](/samples/WebApp/WebApp.csproj) looks like this:
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.3">
<PackageReference Include="Pure.DI" Version="2.1.4">
<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 @@ -55,7 +55,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.3">
<PackageReference Include="Pure.DI" Version="2.1.4">
<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 @@ -62,7 +62,7 @@ The [project file](/samples/WinFormsAppNetCore/WinFormsAppNetCore.csproj) looks
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pure.DI" Version="2.1.3">
<PackageReference Include="Pure.DI" Version="2.1.4">
<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.3">
<PackageReference Include="Pure.DI" Version="2.1.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
24 changes: 21 additions & 3 deletions readme/abstractions-binding.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,24 @@

[![CSharp](https://img.shields.io/badge/C%23-code-blue.svg)](../tests/Pure.DI.UsageTests/Basics/AbstractionsBindingScenario.cs)

You can use the `Bind(...)` method without type parameters. In this case binding will be performed for all abstract types implemented directly and for the implementation type itself.
You can use the `Bind(...)` method without type parameters. In this case binding will be performed for the implementation type itself, and if the implementation is a class or structure, for all abstract but NOT special types that are directly implemented.
Special types include:

- `System.Object`
- `System.Enum`
- `System.MulticastDelegate`
- `System.Delegate`
- `System.Collections.IEnumerable`
- `System.Collections.Generic.IEnumerable&lt;T&gt;`
- `System.Collections.Generic.IList&lt;T&gt;`
- `System.Collections.Generic.ICollection&lt;T&gt;`
- `System.Collections.IEnumerator`
- `System.Collections.Generic.IEnumerator&lt;T&gt;`
- `System.Collections.Generic.IIReadOnlyList&lt;T&gt;`
- `System.Collections.Generic.IReadOnlyCollection&lt;T&gt;`
- `System.IDisposable`
- `System.IAsyncResult`
- `System.AsyncCallback`

```c#
interface IDependency;
Expand All @@ -18,8 +35,9 @@ class Service(

// Specifies to create a partial class "Composition"
DI.Setup("Composition")
// Begins the definition of the binding for all abstract types
// that are directly implemented and the implementation type itself.
// Begins the binding definition for the implementation type itself,
// and if the implementation is a class or structure,
// for all abstract but NOT special types that are directly implemented.
// So that's the equivalent of the following:
// .Bind<IDependency, IOtherDependency, Dependency>()
// .As(Lifetime.PerBlock)
Expand Down
18 changes: 9 additions & 9 deletions readme/tag-unique.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ classDiagram
+ object Resolve(Type type, object? tag)
}
class IEnumerableᐸIDependencyᐸStringᐳᐳ
AbcDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : ad975a96-d565-4aa7-9772-2b91200047e2
AbcDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : 23508a1a-2b97-4f29-8261-361a230ce771
class AbcDependencyᐸStringᐳ {
+AbcDependency()
}
XyzDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : 2467a94e-98f8-4fc4-8ef1-7aa17cbf8942
XyzDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : b8c93da5-50d8-40fc-a590-0712d886be9f
class XyzDependencyᐸStringᐳ {
+XyzDependency()
}
Expand All @@ -64,8 +64,8 @@ classDiagram
class IServiceᐸStringᐳ {
<<abstract>>
}
IEnumerableᐸIDependencyᐸStringᐳᐳ *-- AbcDependencyᐸStringᐳ : ad975a96-d565-4aa7-9772-2b91200047e2 IDependencyᐸStringᐳ
IEnumerableᐸIDependencyᐸStringᐳᐳ *-- XyzDependencyᐸStringᐳ : 2467a94e-98f8-4fc4-8ef1-7aa17cbf8942 IDependencyᐸStringᐳ
IEnumerableᐸIDependencyᐸStringᐳᐳ *-- AbcDependencyᐸStringᐳ : 23508a1a-2b97-4f29-8261-361a230ce771 IDependencyᐸStringᐳ
IEnumerableᐸIDependencyᐸStringᐳᐳ *-- XyzDependencyᐸStringᐳ : b8c93da5-50d8-40fc-a590-0712d886be9f IDependencyᐸStringᐳ
Composition ..> ServiceᐸStringᐳ : IServiceᐸStringᐳ Root
ServiceᐸStringᐳ o-- "PerBlock" IEnumerableᐸIDependencyᐸStringᐳᐳ : IEnumerableᐸIDependencyᐸStringᐳᐳ
```
Expand Down Expand Up @@ -99,7 +99,7 @@ classDiagram
/// var instance = composition.Root;
/// </code>
/// </example>
/// <a href="https://mermaid.live/view#pako:eNqtVcFygjAQ_ZVMzj0goiHeFOwMt4566CGXEIKlFeJAdMY6_oP_0kt_xz8pEFuwhUhrLzsL-5Z9b3cT9pCJgMMRZCuaZW5ElymNSUqS8hk4Il6LLJKRSADZGAaaFLHCMyfenKfbiPHT8X0u0yhZno5vYCaErCBgAWY8E6ttAVrk8fK1XVp8FSb8Z85k4ffvgaTLH2kK8Jmrkha7NQcyN39AO0BfErlVZ7xpsol5Sv1VQdpz-ZonAU_Yrt6OQkqeMfZZc7zsqelWFjll7SnwNAn9MaABRgOKhyozGAwHyrMoRcrDCJnKM33cMw3DsBA3QSVAT6o-6Atk0wRVXx53r_-s0rSGiGJLDcfFdqjqulbILOXZPOwpD1HaQ8wPbWzVVepJ1VVeINtVNi19u742dC6u4tgGqrM7YxSvrrsHgs9IxDPNKnfqUF-JcqifyZSeD8n0bJu-el1W9092VlyqHNcHAq5s-i2nqa11N1PWr-0tR0NH-fttb5azUDbfZs0ya_8FTTFxqZfAB55OVoK9ENj5av0q_ourGN7BHBrTKMj_eXsC5ROPOYEjAgOa5sUP8PAB55WneQ">Class diagram</a><br/>
/// <a href="https://mermaid.live/view#pako:eNqtVc1ygjAQfpVMzj3wIwLeFOwMt4566IFLSKKlBeIAOmMd38F36aWv45s0JLZgC5HWXnYW9tvs9202yR5iRigcQZygovBjtMpRGuZhJr6Bx9I1K-IyZhkIN5pmT6pY5RmTYE7zbYzp6fg-L_M4W52Ob2DGWFlDwALMaMGSbQVa8Lj47QjrXoWx6JnisvLNe1Ci1Y80CfjMlUmL3ZqCkps_oD2gLmn7dWeCabZJaY6ipCId-HRNM0IzvGu2o5LCM8YRbo-Lnhp-bW1P1J6CQJFgjoFhWpqDdCQzjci1pTdYcrbCc4yhLj1zqCPD1DC1bR3UAtSkmht9gWzbQdmXx93rP6uMHOyaBFky09KIrOsPtCWWHrJcTXqarRvEcYYRdZcNlWpSTZUXyG6VbUPfra8LzcXVHLtATXZnjOTVd_YA-YzEtFCMcq8OmVKUh6KizNH5kEzPtm3V67L6L9lbsVA5bm4IuDLpt5ymrtbdTFk9trccDRXl77e9IfZCWj7NimFWvgVtMXapN4QPNJ8kDL-EsPfV-lX8F1cxvIMcmqKY8DdvH8LyiaY0hKMQEpTz4gd4-ACrfqbT">Class diagram</a><br/>
/// This class was created by <a href="https://github.com/DevTeam/Pure.DI">Pure.DI</a> source code generator.
/// </summary>
/// <seealso cref="Pure.DI.DI.Setup"/>
Expand Down Expand Up @@ -236,11 +236,11 @@ partial class Composition
" + object Resolve(Type type, object? tag)\n" +
" }\n" +
" class IEnumerableᐸIDependencyᐸStringᐳᐳ\n" +
" AbcDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : ad975a96-d565-4aa7-9772-2b91200047e2 \n" +
" AbcDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : 23508a1a-2b97-4f29-8261-361a230ce771 \n" +
" class AbcDependencyᐸStringᐳ {\n" +
" +AbcDependency()\n" +
" }\n" +
" XyzDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : 2467a94e-98f8-4fc4-8ef1-7aa17cbf8942 \n" +
" XyzDependencyᐸStringᐳ --|> IDependencyᐸStringᐳ : b8c93da5-50d8-40fc-a590-0712d886be9f \n" +
" class XyzDependencyᐸStringᐳ {\n" +
" +XyzDependency()\n" +
" }\n" +
Expand All @@ -254,8 +254,8 @@ partial class Composition
" class IServiceᐸStringᐳ {\n" +
" <<abstract>>\n" +
" }\n" +
" IEnumerableᐸIDependencyᐸStringᐳᐳ *-- AbcDependencyᐸStringᐳ : ad975a96-d565-4aa7-9772-2b91200047e2 IDependencyᐸStringᐳ\n" +
" IEnumerableᐸIDependencyᐸStringᐳᐳ *-- XyzDependencyᐸStringᐳ : 2467a94e-98f8-4fc4-8ef1-7aa17cbf8942 IDependencyᐸStringᐳ\n" +
" IEnumerableᐸIDependencyᐸStringᐳᐳ *-- AbcDependencyᐸStringᐳ : 23508a1a-2b97-4f29-8261-361a230ce771 IDependencyᐸStringᐳ\n" +
" IEnumerableᐸIDependencyᐸStringᐳᐳ *-- XyzDependencyᐸStringᐳ : b8c93da5-50d8-40fc-a590-0712d886be9f IDependencyᐸStringᐳ\n" +
" Composition ..> ServiceᐸStringᐳ : IServiceᐸStringᐳ Root\n" +
" ServiceᐸStringᐳ o-- \"PerBlock\" IEnumerableᐸIDependencyᐸStringᐳᐳ : IEnumerableᐸIDependencyᐸStringᐳᐳ";
}
Expand Down

0 comments on commit f2f91d2

Please sign in to comment.