Skip to main content
All docs
V24.1

QueryBuildingExtensions.Transform(Source) Method

Creates a TransformationNodeBuilder object that allows you to apply transformation operations to an element of the Federation Data Source.

Namespace: DevExpress.DataAccess.DataFederation

Assembly: DevExpress.DataAccess.v24.1.dll

NuGet Packages: DevExpress.DataAccess, DevExpress.Win.PivotGrid, DevExpress.Win.TreeMap

Declaration

public static TransformationNodeBuilder Transform(
    this Source source
)

Parameters

Name Type Description
source Source

An element of the Federation Data Source.

Returns

Type Description
TransformationNodeBuilder

An object that allows you to apply transformation operations.

Example

The following example demonstrates how to unfold a data source’s Products array:

Show JSON Data
[
    {
        "CategoryID": 1,
        "Products":
        [
            {
                "ProductName": "Chai",
                "UnitPrice": 18
            },
            {
                "ProductName": "Chang",
                "UnitPrice": 19
            }
        ]
    },
    {
        "CategoryID": 2,
        "Products":
        [
            {
                "ProductName": "Ikura",
                "UnitPrice": 31
            },
            {
                "ProductName": "Konbu",
                "UnitPrice": 6
            }
        ]
    }
]
using DevExpress.DataAccess.DataFederation;
using DevExpress.DataAccess.Json;
// ...
var source = new Source("Products", jsonDataSource);

var query = source
    .Transform()
    .UnfoldColumn("Products")
    .Build("ProductsUnfolded");

var federation = new FederationDataSource() {
    Queries = { query }
};

The following schema is the result of the transformation:

"CategoryID": int
"Products"
    "ProductName": string
    "UnitPrice": int
See Also