-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #334 from Sidekick-Poe/feature/package-update
Removed deprecated packages and updated some packages
- Loading branch information
Showing
8 changed files
with
136 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Web; | ||
|
||
namespace Sidekick.Apis.PoeWiki; | ||
|
||
public static class QueryStringHelper | ||
{ | ||
public static string ToQueryString(List<KeyValuePair<string, string>> parameters) | ||
{ | ||
if (parameters == null || parameters.Count == 0) | ||
{ | ||
return string.Empty; | ||
} | ||
|
||
var queryString = new List<string>(); | ||
foreach (var parameter in parameters) | ||
{ | ||
// Encode both the key and value to ensure proper URL encoding | ||
var encodedKey = HttpUtility.UrlEncode(parameter.Key); | ||
var encodedValue = HttpUtility.UrlEncode(parameter.Value); | ||
|
||
// Combine key and value as a query parameter | ||
queryString.Add($"{encodedKey}={encodedValue}"); | ||
} | ||
|
||
// Join all parameters with '&' and prepend a '?' for query string | ||
return "?" + string.Join("&", queryString); | ||
} | ||
|
||
// Overload for dictionary input | ||
public static string ToQueryString(Dictionary<string, string> parameters) | ||
{ | ||
if (parameters == null || parameters.Count == 0) | ||
{ | ||
return string.Empty; | ||
} | ||
|
||
var queryString = new List<KeyValuePair<string, string>>(); | ||
foreach (var parameter in parameters) | ||
{ | ||
queryString.Add(new KeyValuePair<string, string>(parameter.Key, parameter.Value)); | ||
} | ||
|
||
return ToQueryString(queryString); | ||
} | ||
} |
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
1 change: 1 addition & 0 deletions
1
src/Sidekick.Common.Blazor/Settings/General/KeyCloseEditor.razor
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
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