All docs
V20.2
20.2
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

PathParameterCollection.AddRange(PathParameter[]) Method

Appends an array of path parameters to the PathParameterCollection.

Namespace: DevExpress.DataAccess.Json

Assembly: DevExpress.DataAccess.v20.2.dll

Declaration

public void AddRange(
    PathParameter[] items
)
Public Sub AddRange(
    items As PathParameter()
)

Parameters

Name Type Description
items PathParameter[]

An array of PathParameter items to append to the collection.

Remarks

Path parameters are appended to the PathParameterCollection in the same order in which they are stored in the array, and are included in 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.

Examples

The code sample below specifies a JSON endpoint and uses the date and id path parameters to identify the data record requested from the endpoint. The id path parameter is bound to the ID report parameter.

using DevExpress.DataAccess;
using DevExpress.DataAccess.Json;
// ...
// Create a new JSON source.
var jsonSource = new UriJsonSource() {
    Uri = new Uri(@"https://localhost:44367/api/values")
};
// Create the "date" and "id" path parameters that are appended to the JSON URI: https://localhost:44367/api/values/date/2020-01-15/id/123/.
jsonSource.PathParameters.AddRange(new[] {
    new PathParameter("date", typeof(String), String.Format("{0:yyyy-MM-dd}", DateTime.Today)),
    // "ID" is a report parameter whose value is used for the "id" path parameter.
    new PathParameter("id", typeof(Expression), new Expression("?ID"))
});
// Assign the JSON source to the data source.
var datasource = new JsonDataSource() {
    JsonSource = jsonSource
};
See Also