Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Nov 29, 2024
1 parent 053fddc commit 145f7e1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,6 @@ DI.Setup(nameof(Composition))
> [!NOTE]
> In fact, the `Bind().As(Singleton).To<Random>()` binding is unnecessary since _Pure.DI_ supports many .NET BCL types out of the box, including [Random](https://github.com/DevTeam/Pure.DI/blob/27a1ccd604b2fdd55f6bfec01c24c86428ddfdcb/src/Pure.DI.Core/Features/Default.g.cs#L289). It was added just for the example of using the _Singleton_ lifetime.
The Pure.DI source code generator works like this:

```mermaid
flowchart TD
setups[DI setups analysis] --> types["`Types analysis
constructors/methods/properties/fields`"] --> deps[Creating a dependency graph] --> verification[Dependency graph verification] --> code[Code generation]
```

The above code specifies the generation of a partial class named *__Composition__*, this name is defined in the `DI.Setup(nameof(Composition))` call. This class contains a *__Root__* property that returns a graph of objects with an object of type *__Program__* as the root. The type and name of the property is defined by calling `Root<Program>("Root")`. The code of the generated class looks as follows:

```c#
Expand Down Expand Up @@ -339,6 +331,14 @@ DI.Setup("Composition")
<details>
<summary>The following class will be generated</summary>

The source code generator works like this:

```mermaid
flowchart TD
setups[DI setups analysis] --> types["`Types analysis
constructors/methods/properties/fields`"] --> deps[Creating a dependency graph] --> verification[Dependency graph verification] --> code[Code generation]
```

```c#
partial class Composition
{
Expand Down
8 changes: 8 additions & 0 deletions readme/FooterTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ DI.Setup("Composition")
<details>
<summary>The following class will be generated</summary>

The source code generator works like this:

```mermaid
flowchart TD
setups[DI setups analysis] --> types["`Types analysis
constructors/methods/properties/fields`"] --> deps[Creating a dependency graph] --> verification[Dependency graph verification] --> code[Code generation]
```

```c#
partial class Composition
{
Expand Down
8 changes: 0 additions & 8 deletions readme/ReadmeTemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@ DI.Setup(nameof(Composition))
> [!NOTE]
> In fact, the `Bind().As(Singleton).To<Random>()` binding is unnecessary since _Pure.DI_ supports many .NET BCL types out of the box, including [Random](https://github.com/DevTeam/Pure.DI/blob/27a1ccd604b2fdd55f6bfec01c24c86428ddfdcb/src/Pure.DI.Core/Features/Default.g.cs#L289). It was added just for the example of using the _Singleton_ lifetime.
The Pure.DI source code generator works like this:

```mermaid
flowchart TD
setups[DI setups analysis] --> types["`Types analysis
constructors/methods/properties/fields`"] --> deps[Creating a dependency graph] --> verification[Dependency graph verification] --> code[Code generation]
```

The above code specifies the generation of a partial class named *__Composition__*, this name is defined in the `DI.Setup(nameof(Composition))` call. This class contains a *__Root__* property that returns a graph of objects with an object of type *__Program__* as the root. The type and name of the property is defined by calling `Root<Program>("Root")`. The code of the generated class looks as follows:

```c#
Expand Down
2 changes: 1 addition & 1 deletion src/Pure.DI.Core/Features/Default.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ private static void Setup()
.To(_ => global::System.Buffers.ArrayPool<TT>.Shared)
#endif
.Bind<global::System.Collections.Generic.IList<TT>>()
.Bind<global::System.Collections.Generic.ICollection<TT>>()
.Bind<global::System.Collections.Generic.List<TT>>()
.To((TT[] arr) => new global::System.Collections.Generic.List<TT>(arr))
.Bind<global::System.Collections.Generic.ICollection<TT>>()
.Bind<global::System.Collections.ObjectModel.Collection<TT>>()
.To((TT[] arr) => new global::System.Collections.ObjectModel.Collection<TT>(arr))
#if NETSTANDARD || NET || NETCOREAPP || NET45_OR_GREATER
Expand Down

0 comments on commit 145f7e1

Please sign in to comment.