Skip to content

Commit

Permalink
cleanup: run dotnet-format on samples
Browse files Browse the repository at this point in the history
  • Loading branch information
natemcmaster committed Sep 13, 2020
1 parent 0309d1c commit c4547a6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
14 changes: 7 additions & 7 deletions docs/samples/dependency-injection/custom/Program.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using McMaster.Extensions.CommandLineUtils;
using Microsoft.Extensions.DependencyInjection;

namespace CustomServices
{
#region Program
#region Program
[Command(Name = "di", Description = "Dependency Injection sample project")]
[HelpOption]
class Program
Expand Down Expand Up @@ -35,16 +35,16 @@ private void OnExecute()
_myService.Invoke();
}
}
#endregion
#endregion

#region IMyService
#region IMyService
interface IMyService
{
void Invoke();
}
#endregion
#endregion

#region MyServiceImplementation
#region MyServiceImplementation
class MyServiceImplementation : IMyService
{
private readonly IConsole _console;
Expand All @@ -59,5 +59,5 @@ public void Invoke()
_console.WriteLine("Hello dependency injection!");
}
}
#endregion
#endregion
}
15 changes: 8 additions & 7 deletions docs/samples/dependency-injection/generic-host/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace CustomServices
{
#region Program
#region Program
[Command(Name = "di", Description = "Dependency Injection sample project")]
class Program
{
Expand All @@ -28,7 +28,8 @@ public static async Task<int> Main(string[] args)
{
builder.AddConsole();
})
.ConfigureServices((context, services) => {
.ConfigureServices((context, services) =>
{
services.AddSingleton<IGreeter, Greeter>()
.AddSingleton<IConsole>(PhysicalConsole.Singleton);
})
Expand All @@ -51,16 +52,16 @@ private void OnExecute()
_greeter.Greet(Name, Language);
}
}
#endregion
#endregion

#region IGreeter
#region IGreeter
interface IGreeter
{
void Greet(string name, string language);
}
#endregion
#endregion

#region Greeter
#region Greeter
class Greeter : IGreeter
{
private readonly IConsole _console;
Expand All @@ -87,5 +88,5 @@ public void Greet(string name, string language = "english")
_console.WriteLine(greeting, name);
}
}
#endregion
#endregion
}
2 changes: 1 addition & 1 deletion docs/samples/dependency-injection/standard/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace StandardServices
class Program
{
private readonly IConsole _console;

static Task<int> Main(string[] args) => CommandLineApplication.ExecuteAsync<Program>(args);

public Program(IConsole console)
Expand Down

0 comments on commit c4547a6

Please sign in to comment.