sharee.bike-App/TINKLib/Repository/Request/QueryBuilderHelper.cs
Anja Müller-Meißner 573fe77e12 Version 3.0.337
2022-08-30 15:42:25 +02:00

28 lines
1.1 KiB
C#

namespace TINK.Repository.Request
{
public static class QueryBuilderHelper
{
/// <summary>
/// Gets the htlm query string element for session id.
/// </summary>
/// <returns>Query string.</returns>
public static string GetSessionIdQueryElement(
string op,
string merchantId,
string sessionCookie = null)
=> !string.IsNullOrEmpty(merchantId) || !string.IsNullOrEmpty(sessionCookie)
? $"{op}sessionid={(!string.IsNullOrEmpty(sessionCookie) ? sessionCookie : string.Empty)}{(!string.IsNullOrEmpty(merchantId) ? merchantId : string.Empty)}"
: string.Empty;
/// <summary>
/// Gets the htlm query string element for the language.
/// </summary>
/// <param name="uiIsoLangugageName">Two letter ISO language name.</param>
/// <returns>Query string.</returns>
public static string GetLanguageQueryElement(string op, string uiIsoLangugageName)
=> !string.IsNullOrEmpty(uiIsoLangugageName)
? $"{op}lang={uiIsoLangugageName}"
: string.Empty;
}
}