File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
RealTimeWeatherMonitoringApp/Application/Service Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ using RealTimeWeatherMonitoringApp . Application . Common ;
2+ using RealTimeWeatherMonitoringApp . Application . Interfaces ;
3+ using RealTimeWeatherMonitoringApp . Application . Interfaces . Service ;
4+
5+ namespace RealTimeWeatherMonitoringApp . Application . Service ;
6+
7+ public class DataProcessingService < TData > : IDataProcessingService < TData >
8+ {
9+ private readonly IAutoParsingService < TData > _autoParsingService ;
10+ private readonly IDataReceiver < TData > _receiver ;
11+
12+ public DataProcessingService ( IAutoParsingService < TData > autoParsingService , IDataReceiver < TData > receiver )
13+ {
14+ _autoParsingService = autoParsingService ;
15+ _receiver = receiver ;
16+ }
17+
18+ public ParsingResult < TData > Process ( string input )
19+ {
20+ var result = _autoParsingService . AutoParse ( input ) ;
21+ if ( result is { Success : true , Data : not null } )
22+ _receiver . Receive ( result . Data ) ;
23+ return result ;
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments