2019-10-31 13:08:42 +01:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.Hosting;
|
2019-10-31 17:00:52 +01:00
|
|
|
using Squirrowse.Client.Service;
|
2019-11-06 17:02:06 +01:00
|
|
|
using Squirrowse.Core.Services;
|
2019-10-31 10:23:07 +01:00
|
|
|
|
|
|
|
namespace Squirrowse.Client
|
|
|
|
{
|
2019-10-31 13:08:42 +01:00
|
|
|
public class Program
|
2019-10-31 10:23:07 +01:00
|
|
|
{
|
2019-10-31 13:08:42 +01:00
|
|
|
public static void Main(string[] args)
|
2019-10-31 10:23:07 +01:00
|
|
|
{
|
2019-10-31 13:08:42 +01:00
|
|
|
CreateHostBuilder(args).Build().Run();
|
2019-10-31 10:23:07 +01:00
|
|
|
}
|
2019-10-31 13:08:42 +01:00
|
|
|
|
2019-11-04 09:29:37 +01:00
|
|
|
public static IHostBuilder CreateHostBuilder(string[] args)
|
|
|
|
{
|
|
|
|
return Host.CreateDefaultBuilder(args)
|
2019-10-31 13:08:42 +01:00
|
|
|
.ConfigureServices((hostContext, services) =>
|
|
|
|
{
|
|
|
|
services.AddHostedService<Worker>();
|
2019-11-06 13:47:00 +01:00
|
|
|
services.AddSingleton<IConnectionManager>(x =>
|
|
|
|
new ConnectionManager("http://localhost", 5000)); //keep as transient for now
|
|
|
|
services.AddSingleton<ICameraService, CameraService>(x => new CameraService(new Camera()));
|
2019-11-06 11:49:39 +01:00
|
|
|
services.AddSingleton<IActionDispatcher, ActionDispatcher>();
|
2019-10-31 13:08:42 +01:00
|
|
|
});
|
2019-11-04 09:29:37 +01:00
|
|
|
}
|
2019-10-31 10:23:07 +01:00
|
|
|
}
|
2019-11-04 09:29:37 +01:00
|
|
|
}
|