-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor and enhance codebase for .NET 9.0 upgrade
Updated .editorconfig to disable specific naming rule warnings. Refactored exception classes to include remarks and simplify constructors. Changed return type of GetEnumMemberValue to nullable string. Refactored StringExtensions to use var for local variables. Expanded CountryCodeHelper to map three-digit country codes. Removed new() constraint from GetAsync<T> in INhlApiHttpClient. Made HttpClient property nullable in INhlApiHttpClient. Refactored NhlApiHttpClient constructor to use property initializers. Added null checks and exception handling in GetAsync<T>. Replaced ServicePointManager settings with property initializers. Updated HttpClient usages to handle potential null values. Replaced object with Lock for thread synchronization. Added #pragma directives to suppress nullable warnings. Updated TryGetAsync<T> in ICachingService to return nullable type. Simplified initialization of ConcurrentDictionary in CachingService. Updated NhlApiAsyncHelper to use simplified TaskFactory initialization. Updated model classes to use required keyword for properties. Targeted .NET 9.0 and incremented version to 3.7.0 in project file. Removed redundant using directives and added necessary ones. Simplified initialization of static fields in various classes. Added CultureInfo.InvariantCulture to string operations. Refactored tests to improve consistency and readability. Added InvalidTeamAbbreviationException for error handling.
- Loading branch information
1 parent
056cdf8
commit a7c7ee6
Showing
94 changed files
with
1,928 additions
and
1,155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
Nhl.Api.Common/Exceptions/InvalidTeamAbbreviationException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
|
||
namespace Nhl.Api.Common.Exceptions; | ||
|
||
/// <summary> | ||
/// This exception is thrown when an invalid team abbreviation is used | ||
/// </summary> | ||
public class InvalidTeamAbbreviationException(string message) : Exception | ||
{ | ||
/// <summary> | ||
/// The exception message | ||
/// </summary> | ||
public override string Message => message; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.