Creates a new DataServiceQuery<TElement> with the query option set in the URI generated by the returned query.
Assembly: Microsoft.Data.Services.Client (in Microsoft.Data.Services.Client.dll)
- Type: System.String
The string value that contains the name of the query string option to add.
- Type: System.Object
The object that contains the value of the query string option.
The query options are added to the resultant URI using ?name=value&name2=value2… syntax where the name maps directly to the name parameter and the value is obtained by calling ToString on the value parameter. The name starts with $.
Non-WCF Data Services syntax does not start with $. Non-WCF Data Services query options can be added using this method. It is legal to add the same query option twice if the option is not an WCF Data Services query option. If a query option is added that is already present in the underlying URI, an exception is thrown.
The $select query option cannot be added to a query URI by using the method. We recommend that you use the LINQ Select<TSource, TResult>(IEnumerable<TSource>, Func<TSource, TResult>) method and have the client generate the $select query option in the request URI.