Seperated eventhub service from api service.

wip nbs flow.
Changed uploading a bit.
This commit is contained in:
2020-03-25 21:32:28 +01:00
parent e638370ad4
commit 691be2185e
11 changed files with 151 additions and 81 deletions

View File

@@ -1,10 +1,11 @@
using System.Threading.Tasks;
using System;
using System.Threading.Tasks;
using FarmmapsApi;
using FarmmapsApi.Models;
using FarmmapsApi.Services;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Console;
namespace FarmmapsApiSamples
{
@@ -20,17 +21,15 @@ namespace FarmmapsApiSamples
var serviceProvider = new ServiceCollection()
.AddLogging(opts => opts
.AddConsole(c =>
{
c.IncludeScopes = false;
c.Format = ConsoleLoggerFormat.Default;
})
.AddConsole()
.AddFilter("System.Net.Http", LogLevel.Warning))
.AddFarmmapsServices(configuration)
.AddTransient<NitrogenService>()
.AddSingleton<IApp, NbsApp>()
.BuildServiceProvider();
await serviceProvider.GetService<FarmmapsApiService>().AuthenticateAsync();
await serviceProvider.GetService<FarmmapsEventHub>().StartEventHub();
await serviceProvider.GetService<IApp>().RunAsync();
}
}