sharee.bike-App/TINKLib/Repository/Request/QueryBuilderHelper.cs
Anja Müller-Meißner 0468955d49 Version 3.0.338
2022-09-08 09:55:14 +02:00

29 lines
995 B
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;
}
}