From 15d27036b390a12d084e9230a571feff4df7def4 Mon Sep 17 00:00:00 2001 From: Andre Fischbacher Date: Sun, 24 Nov 2024 19:17:54 -0500 Subject: [PATCH 1/3] Make various properties nullable and set default values Modified the `Total` property in `PlayerRealtimeStatisticsFilterResult` to have a default value of 0. Changed `HitsPer60` and `TakeawaysPer60` in `PlayerRealtimeStatisticsResult` to nullable doubles. Updated several properties in `PlayerStatisticsResult` from non-nullable to nullable types, including `GameWinningGoals`, `GamesPlayed`, `Goals`, `OvertimeGoals`, `PenaltyMinutes`, `Points` (int to int?) and `PointsPerGame` (decimal to decimal?). Changed `Total` in `PlayerTimeOnIceStatisticsFilterResult` from int to int?. Updated multiple properties in `PlayerTimeOnIceStatisticsResult` from non-nullable to nullable types, including `EvTimeOnIce`, `GamesPlayed`, `OtTimeOnIce`, `PpTimeOnIce`, `SeasonId`, `ShTimeOnIce`, `Shifts`, `TimeOnIce` (int to int?) and `EvTimeOnIcePerGame`, `OtTimeOnIcePerOtGame`, `PpTimeOnIcePerGame`, `ShTimeOnIcePerGame`, `ShiftsPerGame` (double to double?). --- .../PlayerRealtimeStatisticsFilterResult.cs | 4 ++-- .../PlayerStatisticsFilterResult.cs | 14 ++++++------- .../PlayerTimeOnIceStatisticsFilterResult.cs | 20 +++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Nhl.Api.Domain/Models/Statistics/PlayerRealtimeStatisticsFilterResult.cs b/Nhl.Api.Domain/Models/Statistics/PlayerRealtimeStatisticsFilterResult.cs index eac58c6..3ddab3a 100644 --- a/Nhl.Api.Domain/Models/Statistics/PlayerRealtimeStatisticsFilterResult.cs +++ b/Nhl.Api.Domain/Models/Statistics/PlayerRealtimeStatisticsFilterResult.cs @@ -90,7 +90,7 @@ public class PlayerRealtimeStatisticsResult /// Hits per 60 minutes. /// [JsonProperty("hitsPer60")] - public double HitsPer60 { get; set; } + public double? HitsPer60 { get; set; } /// /// Player's last name. @@ -186,7 +186,7 @@ public class PlayerRealtimeStatisticsResult /// Takeaways per 60 minutes. /// [JsonProperty("takeawaysPer60")] - public double TakeawaysPer60 { get; set; } + public double? TakeawaysPer60 { get; set; } /// /// Team abbreviation. diff --git a/Nhl.Api.Domain/Models/Statistics/PlayerStatisticsFilterResult.cs b/Nhl.Api.Domain/Models/Statistics/PlayerStatisticsFilterResult.cs index 52d8476..d9ad23c 100644 --- a/Nhl.Api.Domain/Models/Statistics/PlayerStatisticsFilterResult.cs +++ b/Nhl.Api.Domain/Models/Statistics/PlayerStatisticsFilterResult.cs @@ -59,21 +59,21 @@ public class PlayerStatisticsResult /// Example: 2 /// [JsonProperty("gameWinningGoals")] - public int GameWinningGoals { get; set; } + public int? GameWinningGoals { get; set; } /// /// The NHL player games played
/// Example: 78 ///
[JsonProperty("gamesPlayed")] - public int GamesPlayed { get; set; } + public int? GamesPlayed { get; set; } /// /// The NHL player goals
/// Example: 10 ///
[JsonProperty("goals")] - public int Goals { get; set; } + public int? Goals { get; set; } /// /// The NHL player last name
@@ -87,14 +87,14 @@ public class PlayerStatisticsResult /// Example: 1 ///
[JsonProperty("otGoals")] - public int OvertimeGoals { get; set; } + public int? OvertimeGoals { get; set; } /// /// The NHL player penalty minutes
/// Example: 20 ///
[JsonProperty("penaltyMinutes")] - public int PenaltyMinutes { get; set; } + public int? PenaltyMinutes { get; set; } /// /// The NHL player player identifier
@@ -115,14 +115,14 @@ public class PlayerStatisticsResult /// Example: 20 ///
[JsonProperty("points")] - public int Points { get; set; } + public int? Points { get; set; } /// /// The NHL player points per game
/// Example: 0.356732 ///
[JsonProperty("pointsPerGame")] - public decimal PointsPerGame { get; set; } + public decimal? PointsPerGame { get; set; } /// /// The NHL player position code
diff --git a/Nhl.Api.Domain/Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs b/Nhl.Api.Domain/Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs index 06c5ccf..962d68e 100644 --- a/Nhl.Api.Domain/Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs +++ b/Nhl.Api.Domain/Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs @@ -30,13 +30,13 @@ public class PlayerTimeOnIceStatisticsResult /// Even strength time on ice in seconds. ///
[JsonProperty("evTimeOnIce")] - public int EvTimeOnIce { get; set; } + public int? EvTimeOnIce { get; set; } /// /// Even strength time on ice per game in seconds. /// [JsonProperty("evTimeOnIcePerGame")] - public double EvTimeOnIcePerGame { get; set; } + public double? EvTimeOnIcePerGame { get; set; } /// /// Number of games played. @@ -54,13 +54,13 @@ public class PlayerTimeOnIceStatisticsResult /// Overtime time on ice in seconds. /// [JsonProperty("otTimeOnIce")] - public int OtTimeOnIce { get; set; } + public int? OtTimeOnIce { get; set; } /// /// Overtime time on ice per overtime game in seconds. /// [JsonProperty("otTimeOnIcePerOtGame")] - public double OtTimeOnIcePerOtGame { get; set; } + public double? OtTimeOnIcePerOtGame { get; set; } /// /// Player's ID. @@ -78,31 +78,31 @@ public class PlayerTimeOnIceStatisticsResult /// Power play time on ice in seconds. /// [JsonProperty("ppTimeOnIce")] - public int PpTimeOnIce { get; set; } + public int? PpTimeOnIce { get; set; } /// /// Power play time on ice per game in seconds. /// [JsonProperty("ppTimeOnIcePerGame")] - public double PpTimeOnIcePerGame { get; set; } + public double? PpTimeOnIcePerGame { get; set; } /// /// Season ID. /// [JsonProperty("seasonId")] - public int SeasonId { get; set; } + public int? SeasonId { get; set; } /// /// Short-handed time on ice in seconds. /// [JsonProperty("shTimeOnIce")] - public int ShTimeOnIce { get; set; } + public int? ShTimeOnIce { get; set; } /// /// Short-handed time on ice per game in seconds. /// [JsonProperty("shTimeOnIcePerGame")] - public double ShTimeOnIcePerGame { get; set; } + public double? ShTimeOnIcePerGame { get; set; } /// /// Number of shifts. @@ -138,7 +138,7 @@ public class PlayerTimeOnIceStatisticsResult /// Total time on ice in seconds. /// [JsonProperty("timeOnIce")] - public int TimeOnIce { get; set; } + public int? TimeOnIce { get; set; } /// /// Time on ice per game in seconds. From 5481c7b80f4e1828f8918a7f5280ad2a32a0b91c Mon Sep 17 00:00:00 2001 From: Andre Fischbacher Date: Sun, 24 Nov 2024 19:18:26 -0500 Subject: [PATCH 2/3] Bump project version to 3.6.1 Updated the version number from 3.6.0 to 3.6.1 in the following files: - Nhl.Api.Common.csproj - Nhl.Api.Domain.csproj - Nhl.Api.Tests.csproj - Nhl.Api.csproj --- Nhl.Api.Common/Nhl.Api.Common.csproj | 2 +- Nhl.Api.Domain/Nhl.Api.Domain.csproj | 2 +- Nhl.Api.Tests/Nhl.Api.Tests.csproj | 4 ++-- Nhl.Api/Nhl.Api.csproj | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Nhl.Api.Common/Nhl.Api.Common.csproj b/Nhl.Api.Common/Nhl.Api.Common.csproj index 9d6a778..a6880c2 100644 --- a/Nhl.Api.Common/Nhl.Api.Common.csproj +++ b/Nhl.Api.Common/Nhl.Api.Common.csproj @@ -1,7 +1,7 @@ - 3.6.0 + 3.6.1 net8.0 true enable diff --git a/Nhl.Api.Domain/Nhl.Api.Domain.csproj b/Nhl.Api.Domain/Nhl.Api.Domain.csproj index 4259904..73214b8 100644 --- a/Nhl.Api.Domain/Nhl.Api.Domain.csproj +++ b/Nhl.Api.Domain/Nhl.Api.Domain.csproj @@ -1,7 +1,7 @@ - 3.6.0 + 3.6.1 net8.0 true enable diff --git a/Nhl.Api.Tests/Nhl.Api.Tests.csproj b/Nhl.Api.Tests/Nhl.Api.Tests.csproj index 1d79a8d..2cac84f 100644 --- a/Nhl.Api.Tests/Nhl.Api.Tests.csproj +++ b/Nhl.Api.Tests/Nhl.Api.Tests.csproj @@ -1,7 +1,7 @@ - + - 3.6.0 + 3.6.1 net8.0 false true diff --git a/Nhl.Api/Nhl.Api.csproj b/Nhl.Api/Nhl.Api.csproj index 94a6ba3..5a85faa 100644 --- a/Nhl.Api/Nhl.Api.csproj +++ b/Nhl.Api/Nhl.Api.csproj @@ -1,7 +1,7 @@ - 3.6.0 + 3.6.1 net8.0 Nhl.Api Nhl.Api From 056cdf8230930982aaafe57627527f02d8cdd05b Mon Sep 17 00:00:00 2001 From: Andre Fischbacher Date: Sun, 24 Nov 2024 19:20:04 -0500 Subject: [PATCH 3/3] Make SeasonId non-nullable in PlayerTimeOnIceStatistics Changed SeasonId in PlayerTimeOnIceStatisticsResult from int? to int. This ensures SeasonId always has a valid integer value, preventing potential null reference issues in the code. --- .../Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nhl.Api.Domain/Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs b/Nhl.Api.Domain/Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs index 962d68e..021c2fa 100644 --- a/Nhl.Api.Domain/Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs +++ b/Nhl.Api.Domain/Models/Statistics/PlayerTimeOnIceStatisticsFilterResult.cs @@ -90,7 +90,7 @@ public class PlayerTimeOnIceStatisticsResult /// Season ID. /// [JsonProperty("seasonId")] - public int? SeasonId { get; set; } + public int SeasonId { get; set; } /// /// Short-handed time on ice in seconds.