Skip to content

Commit 5f7c2c1

Browse files
committed
BugFix field name
Field name should be `Type` so that its deserialized from configuration.json correctly.
1 parent 2b785d1 commit 5f7c2c1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

RealTimeWeatherMonitoringApp/Infrastructure/Configuration/ConditionConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
namespace RealTimeWeatherMonitoringApp.Infrastructure.Configuration;
44

55
public record ConditionConfiguration(
6-
ConditionType ConditionType,
6+
ConditionType Type,
77
ConditionOperator Operator,
88
double Value);

RealTimeWeatherMonitoringApp/Infrastructure/Factory/WeatherEvaluatorFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ public IEvaluator<WeatherData> CreateEvaluator(ConditionConfiguration config)
1313
{
1414
var value = config.Value;
1515
var comparison = GetComparisonOperator(config.Operator);
16-
return config.ConditionType switch
16+
return config.Type switch
1717
{
1818
ConditionType.Temperature => new WeatherTemperatureEvaluator(value, comparison),
1919
ConditionType.Humidity => new WeatherHumidityEvaluator(value, comparison),
20-
_ => throw new ArgumentException($"Unsupported weather condition type: {config.ConditionType}")
20+
_ => throw new ArgumentException($"Unsupported weather condition type: {config.Type}")
2121
};
2222
}
2323

0 commit comments

Comments
 (0)