Back to Devexpress

UriJsonSource.QueryParameters Property

corelibraries-devexpress-dot-dataaccess-dot-json-dot-urijsonsource-bb066994.md

latest3.3 KB
Original Source

UriJsonSource.QueryParameters Property

Provides access to a collection of parameters that the UriJsonSource passes to a JSON endpoint as HTTP request parameters.

Namespace : DevExpress.DataAccess.Json

Assembly : DevExpress.DataAccess.v25.2.dll

NuGet Package : DevExpress.DataAccess

Declaration

csharp
[Browsable(false)]
public QueryParameterCollection QueryParameters { get; }
vb
<Browsable(False)>
Public ReadOnly Property QueryParameters As QueryParameterCollection

Property Value

TypeDescription
QueryParameterCollection

Lists query parameters.

|

Remarks

This property stores a collection of query parameters that the UriJsonSource appends to a JSON endpoint’s Uri.

The parameters are added to endpoint requests in the same order in which they are stored in the collection. Change the order of elements in the collection to reposition parameters in endpoint requests.

Example

csharp
public static JsonDataSource CreateDataSourceWithAuthenticationInCode() {
    // Create a new UriJsonSource object and configure authentication data in it
    var jsonSource = new DevExpress.DataAccess.Json.UriJsonSource();
    jsonSource.Uri = new Uri(@"https://northwind.netcore.io/customers.json");

    jsonSource.QueryParameters.Add(new QueryParameter("id", "123456"));
    jsonSource.QueryParameters.Add(new QueryParameter("name", "MyName"));

    // Create JsonDataSource
    var jsonDataSource = new DevExpress.DataAccess.Json.JsonDataSource() {
        JsonSource = jsonSource
    };
    jsonDataSource.Fill();
}
vb
Public Shared Function CreateDataSourceWithAuthenticationInCode() As JsonDataSource
    ' Create a new UriJsonSource object and configure authentication data in it
    Dim jsonSource = New DevExpress.DataAccess.Json.UriJsonSource()
    jsonSource.Uri = New Uri("https://northwind.netcore.io/customers.json")

  jsonSource.QueryParameters.Add([New] QueryParameter("id", "123456"))
  jsonSource.QueryParameters.Add([New] QueryParameter("name", "MyName"))

    ' Create JsonDataSource
    Dim jsonDataSource = New DevExpress.DataAccess.Json.JsonDataSource() With {.JsonSource = jsonSource}
    jsonDataSource.Fill()
End Function

See Also

AuthenticationInfo

ConnectionName

UriJsonSource Class

UriJsonSource Members

DevExpress.DataAccess.Json Namespace