Skip to content

Commit f398662

Browse files
committed
Implement program entry point with proper initialization
1 parent 183be7b commit f398662

File tree

1 file changed

+14
-0
lines changed
  • RealTimeWeatherMonitoringApp/Presentation

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1+
using Microsoft.Extensions.DependencyInjection;
2+
using RealTimeWeatherMonitoringApp.Application.Interfaces;
3+
using RealTimeWeatherMonitoringApp.Application.Interfaces.Service;
4+
using RealTimeWeatherMonitoringApp.Domain.Interfaces.Service;
5+
using RealTimeWeatherMonitoringApp.Domain.Models;
16
using RealTimeWeatherMonitoringApp.Presentation;
27

8+
// Inject Dependencies
39
var provider = DependencyInjector.CreateServiceProvider();
10+
11+
// Initialize Bot Events
12+
var weatherBotPublisher = provider.GetRequiredService<IBotPublishingService>();
13+
var weatherDataNotifier = provider.GetRequiredService<IDataChangeNotifier<WeatherData>>();
14+
var weatherEventManager = provider.GetRequiredService<IBotEventManager<WeatherData>>();
15+
weatherEventManager.Attach(weatherDataNotifier, weatherBotPublisher);
16+
17+
// Start
418
new UserController(provider).Start();

0 commit comments

Comments
 (0)