diff --git a/SteamStorefrontAPI/Endpoints/AppDetails.cs b/SteamStorefrontAPI/Endpoints/AppDetails.cs index d686d98..0a09f24 100644 --- a/SteamStorefrontAPI/Endpoints/AppDetails.cs +++ b/SteamStorefrontAPI/Endpoints/AppDetails.cs @@ -16,19 +16,19 @@ namespace SteamStorefrontAPI public static async Task GetAsync(int AppId) { - return await GetAsync(AppId, null, null); + return await GetAsync(AppId, "", ""); } public static async Task GetAsync(int AppId, string CountryCode) { - return await GetAsync(AppId, CountryCode, null); + return await GetAsync(AppId, CountryCode, ""); } public static async Task GetAsync(int AppId, string CountryCode, string Language) { string steamUri = $"{steamBaseUri}?appids={AppId}"; - steamUri = CountryCode is null ? steamUri : $"{steamUri}&cc={CountryCode}"; - steamUri = Language is null ? steamUri : $"{steamUri}&l={Language}"; + steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}&cc={CountryCode}"; + steamUri = string.IsNullOrWhiteSpace(Language) ? steamUri : $"{steamUri}&l={Language}"; var response = await client.GetAsync(steamUri); if (!response.IsSuccessStatusCode) { return null; } diff --git a/SteamStorefrontAPI/Endpoints/Featured.cs b/SteamStorefrontAPI/Endpoints/Featured.cs index 93ab539..a9f7220 100644 --- a/SteamStorefrontAPI/Endpoints/Featured.cs +++ b/SteamStorefrontAPI/Endpoints/Featured.cs @@ -28,8 +28,8 @@ namespace SteamStorefrontAPI public static async Task GetAsync(string CountryCode, string Language) { string steamUri = steamBaseUri; - steamUri = CountryCode is null ? steamUri : $"{steamUri}&cc={CountryCode}"; - steamUri = Language is null ? steamUri : $"{steamUri}&l={Language}"; + steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}&cc={CountryCode}"; + steamUri = string.IsNullOrWhiteSpace(Language) ? steamUri : $"{steamUri}&l={Language}"; var response = await client.GetAsync(steamUri); if (!response.IsSuccessStatusCode) { return null; } diff --git a/SteamStorefrontAPI/Endpoints/FeaturedCategories.cs b/SteamStorefrontAPI/Endpoints/FeaturedCategories.cs index ec07e45..1724392 100644 --- a/SteamStorefrontAPI/Endpoints/FeaturedCategories.cs +++ b/SteamStorefrontAPI/Endpoints/FeaturedCategories.cs @@ -27,8 +27,8 @@ namespace SteamStorefrontAPI public static async Task> GetAsync(string CountryCode, string Language) { string steamUri = steamBaseUri; - steamUri = CountryCode is null ? steamUri : $"{steamUri}&cc={CountryCode}"; - steamUri = Language is null ? steamUri : $"{steamUri}&l={Language}"; + steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}&cc={CountryCode}"; + steamUri = string.IsNullOrWhiteSpace(Language) ? steamUri : $"{steamUri}&l={Language}"; var response = await client.GetAsync(steamUri); if (!response.IsSuccessStatusCode) { return null; } diff --git a/SteamStorefrontAPI/Endpoints/PackageDetails.cs b/SteamStorefrontAPI/Endpoints/PackageDetails.cs index 4d952e2..0093ce9 100644 --- a/SteamStorefrontAPI/Endpoints/PackageDetails.cs +++ b/SteamStorefrontAPI/Endpoints/PackageDetails.cs @@ -27,8 +27,8 @@ namespace SteamStorefrontAPI public static async Task GetAsync(int PackageId, string CountryCode, string Language) { string steamUri = $"{steamBaseUri}?packageids={PackageId}"; - steamUri = CountryCode is null ? steamUri : $"{steamUri}&cc={CountryCode}"; - steamUri = Language is null ? steamUri : $"{steamUri}&l={Language}"; + steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}&cc={CountryCode}"; + steamUri = string.IsNullOrWhiteSpace(Language) ? steamUri : $"{steamUri}&l={Language}"; var response = await client.GetAsync(steamUri); if (!response.IsSuccessStatusCode) { return null; }