/// <summary> /// Matches a request by query string. /// </summary> /// <param name="builder">The request matching builder instance.</param> /// <param name="key">The query string parameter key.</param> /// <param name="value">The query string value.</param> /// <returns>The request matching builder instance.</returns> public static RequestMatching QueryString(this RequestMatching builder, string key, string value) { return(builder.QueryString( key, value is null #if NETSTANDARD1_1 || NETFRAMEWORK ? new string[0] #else ? Array.Empty <string>() #endif : new[] { value })); }
/// <summary> /// Matches a request by query string. /// </summary> /// <param name="builder">The request matching builder instance.</param> /// <param name="key">The query string parameter key.</param> /// <param name="values">The query string values.</param> /// <returns>The request matching builder instance.</returns> public static RequestMatching QueryString(this RequestMatching builder, string key, IEnumerable <string> values) { if (key is null) { throw new ArgumentNullException(nameof(key)); } return(builder.QueryString(new Dictionary <string, IEnumerable <string> > { { key, values } })); }
/// <summary> /// Matches a request by query string. /// </summary> /// <param name="builder">The request matching builder instance.</param> /// <param name="key">The query string parameter key.</param> /// <param name="values">The query string value.</param> /// <returns>The request matching builder instance.</returns> public static RequestMatching QueryString(this RequestMatching builder, string key, params string[] values) { return(builder.QueryString(key, values?.AsEnumerable())); }