public ListAllAgentsRequest( string email = null, string mobile = null, string phone = null, AgentState?agentState = null) { var urlParams = new Dictionary <string, string> { { "email", email }, { "mobile", mobile }, { "phone", phone }, { "state", agentState?.GetQueryStringValue() } }.Where(x => x.Value != null) .Select(queryParam => $"{queryParam.Key}={Uri.EscapeDataString(queryParam.Value)}") .ToList(); UrlWithQueryString = ListAllContactsUrl + (urlParams.Any() ? "?" + string.Join("&", urlParams) : ""); }