forked from nanoframework/Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
31 lines (27 loc) · 942 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
26
27
28
29
30
31
//
// Copyright (c) .NET Foundation and Contributors
// See LICENSE file in the project root for full license information.
//
using Microsoft.Extensions.DependencyInjection;
using nanoFramework.Logging.Debug;
using Microsoft.Extensions.Logging;
namespace nanoFramework.SlowBlink
{
public class Program
{
public static void Main()
{
ServiceProvider services = ConfigureServices();
var application = (Application)services.GetRequiredService(typeof(Application));
application.Run();
}
private static ServiceProvider ConfigureServices()
{
return new ServiceCollection()
.AddSingleton(typeof(Application))
.AddSingleton(typeof(IHardwareService), typeof(HardwareService))
.AddSingleton(typeof(ILoggerFactory), typeof(DebugLoggerFactory))
.BuildServiceProvider();
}
}
}