Seperated eventhub service from api service.
wip nbs flow. Changed uploading a bit.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user