sharee.bike-App/SharedBusinessLogic/Repository/Request/QueryBuilderHelper.cs
2024-04-09 12:53:23 +02:00

28 lines
1,001 B
C#

namespace ShareeBike.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;
}
}