All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
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.

QueryBuildingExtensions.Transform(IJoinNode) Method

Creates a TransformationNodeBuilder object that allows you to apply transformations to a node created after the Join, Select, Union, or Union All operations.

Namespace: DevExpress.DataAccess.DataFederation

Assembly: DevExpress.DataAccess.v21.1.dll

Declaration

public static TransformationNodeBuilder Transform(
    this IJoinNode root
)

Parameters

Name Type Description
root IJoinNode

A node created after the Join, Select, Union, or Union All operations.

Returns

Type Description
TransformationNodeBuilder

An object that allows you to apply transformation operations.

Example

The following example demonstrates how to unfold and flatten the Products array of two data sources and unite data from these sources.

Show JSON Data (Products1.json)
[
    {
        "CategoryID": 1,
        "Products":
        [
            {
                "ProductName": "Chai",
                "UnitPrice": 18
            },
            {
                "ProductName": "Chang",
                "UnitPrice": 19
            }
        ]
    },
    {
        "CategoryID": 2,
        "Products":
        [
            {
                "ProductName": "Ikura",
                "UnitPrice": 31
            },
            {
                "ProductName": "Konbu",
                "UnitPrice": 6
            }
        ]
    }
]
Show JSON Data (Products2.json)
[
    {
        "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 source1 = new Source("Products1", jsonDataSource1);
var source2 = new Source("Products2", jsonDataSource2);

var query = source1
    .From()
    .Select("Products")
    .Build()
    .Union(source2
        .From()
        .Select("Products")
        .Build())
    .Build()
    .Transform()
    .TransformColumn("Products")
    .Build("ProductsUnited");

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

The following schema is the result of the transformation:

"Products_ProductName": string
"Products_UnitPrice" : string
See Also