Skip to content

Commit

Permalink
Improved templates
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov committed Apr 13, 2024
1 parent 7a92b93 commit 9e49af0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
1 change: 1 addition & 0 deletions src/Pure.DI.Templates/Pure.DI.Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
</PropertyGroup>

<ItemGroup>
<Compile Include="Templates\Pure.DI.Template.ClassLibrary\GlobalUsings.cs" />
<Content Include="Templates\**\*" Exclude="Templates\**\bin\**;Templates\**\obj\**">
<PackagePath>content</PackagePath>
</Content>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
global using System;
global using System.Diagnostics;
global using Pure.DI;
global using static Pure.DI.Lifetime;
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
using System.Diagnostics;
using Pure.DI;
using static Pure.DI.Lifetime;
namespace _PureDIProjectName_;

namespace _PureDIProjectName_;

/// <summary>
/// Pure.DI Composition Setup. Please see <see href="https://github.com/DevTeam/Pure.DI.Solution">this</see> example.
/// </summary>
internal class $(CompositionName)
{
[Conditional("DI")]
void Setup() =>
private void Setup() =>
DI.Setup(nameof($(CompositionName)), CompositionKind.Global)
.Bind().As(Singleton).To<ConsoleAdapter>();
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
global using _PureDIProjectName_;
global using System;
global using System.Diagnostics;
global using System.Diagnostics;
global using Pure.DI;
global using static Pure.DI.Lifetime;
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
using Pure.DI;
using static Pure.DI.Lifetime;
namespace _PureDIProjectName_;

namespace _PureDIProjectName_;

/// <summary>
/// Pure.DI Composition Setup. Please see <see href="https://github.com/DevTeam/Pure.DI.Solution">this</see> example.
/// </summary>
internal partial class $(CompositionName)
{
[Conditional("DI")]
void Setup() =>
private void Setup() =>
DI.Setup(nameof($(CompositionName)))
.Arg<string[]>("args")
.Bind().As(Singleton).To<ConsoleAdapter>()
.Root<Program>("Root");
}

0 comments on commit 9e49af0

Please sign in to comment.