generated from dotnet-demos/template-console-menu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
25 lines (23 loc) · 924 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System.Threading.Tasks;
using DotNet.Helpers;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace ConsoleApp
{
class Program
{
async static Task Main (string[] args) =>
await Host.CreateDefaultBuilder(args)
.ConfigureServices((hostBuilderContext, services) =>
{
services.AddHostedService<MenuService>();
services.AddScoped<IDependency, Dependency>();
services.AddSingleton<RandomOption>();
services.AddScoped<RandomNumberGeneratorOption>();
services.AddLogging();
})
//.UseConsoleLifetime() // This may be used when running inside container. But we dont really run an interative menu program in container.
.Build()
.RunAsync();
}
}