generated from dotnet-demos/template-console-menu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
24 lines (23 loc) · 961 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
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<ISourceCodeProvider, HardCodedSouceCodeProvider>();
services.AddSingleton<CompileWithAnalyzersOption>();
services.AddSingleton<CompileOption>();
services.AddSingleton<CompilationProvider>();
})
//.UseConsoleLifetime() // This may be used when running inside container. But we dont really run an interative menu program in container.
.Build()
.RunAsync();
}
}