File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
RealTimeWeatherMonitoringApp/Domain/Models/Controller Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ using RealTimeWeatherMonitoringApp . Domain . Common ;
2+ using RealTimeWeatherMonitoringApp . Domain . Interfaces ;
3+ using RealTimeWeatherMonitoringApp . Domain . Interfaces . Service ;
4+
5+ namespace RealTimeWeatherMonitoringApp . Domain . Models . Controller ;
6+
7+ /// <summary>
8+ /// A BotController that publishes its events to an IBotPublishingService
9+ /// </summary>
10+ public class PublisherBotController < TEvaluated > : IBotController < TEvaluated >
11+ {
12+ private readonly IBotController < TEvaluated > _botController ;
13+ private readonly IBotPublishingService _publishingService ;
14+
15+ public PublisherBotController (
16+ IBotController < TEvaluated > botController ,
17+ IBotPublishingService publishingService )
18+ {
19+ _botController = botController ;
20+ _publishingService = publishingService ;
21+ }
22+
23+ public BotEventArgs ? React ( DataChangeEventArgs < TEvaluated > args )
24+ {
25+ var botEventArgs = _botController . React ( args ) ;
26+ if ( botEventArgs != null )
27+ _publishingService . Publish ( botEventArgs ) ;
28+ return botEventArgs ;
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments