Skip to content

Commit 6e94758

Browse files
994112: Updated the UG content and samples for Blazor DataManger Component
1 parent ad52ed0 commit 6e94758

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

blazor/data/adaptors.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ documentation: ug
1313

1414
The [SfDataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.SfDataManager.html) component provides a unified approach for interacting with diverse data sources in Blazor applications. Each data source or remote service may define unique **request** and **response** formats. To manage these variations, the `SfDataManager` uses an **adaptor** mechanism that translates data operations into a format compatible with the target service.
1515

16-
1716
* **Local data sources**: An adaptor applies query operations such as **sorting**, **filtering**, and **paging** directly on an **in-memory collection**.
1817
* **Remote data sources**: An adaptor generates the required H**TTP requests** and processes the corresponding server **responses**.
1918

@@ -30,8 +29,6 @@ The `SfDataManager` component provides several built-in adaptors for integrating
3029
* **GraphQLAdaptor** – Enables interaction with GraphQL services for queries and mutations.
3130
* **CustomAdaptor** – Allows custom implementations when built-in adaptors do not meet requirements.
3231

33-
N> `ODataAdaptor` is the default adaptor used by `SfDataManager`.
34-
3532
## UrlAdaptor
3633

3734
The **UrlAdaptor** is the base adaptor for remote data services. It converts query operations into **HTTP requests** and processes the corresponding server **responses**. This adaptor is suitable for endpoints that do not implement specialized protocols such as **OData** or **GraphQL**.
@@ -51,11 +48,11 @@ To configure the `UrlAdaptor`, set the [Adaptor](https://help.syncfusion.com/cr/
5148
@using Syncfusion.Blazor.Grids
5249
5350
<SfGrid TValue="EmployeeData" ID="Grid" AllowPaging="true">
54-
<SfDataManager Url="https://service-endpoint/api/employees" Adaptor="Adaptors.UrlAdaptor"></SfDataManager>
51+
<SfDataManager Url="https://blazor.syncfusion.com/services/development/api/gridurldata" Adaptor="Adaptors.UrlAdaptor"></SfDataManager>
5552
<GridColumns>
56-
<GridColumn Field="@nameof(EmployeeData.EmployeeID)" HeaderText="Employee ID" TextAlign="TextAlign.Center" Width="120"></GridColumn>
57-
<GridColumn Field="@nameof(EmployeeData.Name)" HeaderText="First Name" Width="130"></GridColumn>
58-
<GridColumn Field="@nameof(EmployeeData.Title)" HeaderText="Title" Width="120"></GridColumn>
53+
<GridColumn Field="@nameof(EmployeeData.EmployeeID)" HeaderText="Employee ID" TextAlign="Syncfusion.Blazor.Grids.TextAlign.Center" Width="120"></GridColumn>
54+
<GridColumn Field="@nameof(EmployeeData.EmployeeName)" HeaderText="First Name" Width="130"></GridColumn>
55+
<GridColumn Field="@nameof(EmployeeData.Designation)" HeaderText="Title" Width="120"></GridColumn>
5956
</GridColumns>
6057
</SfGrid>
6158
@@ -64,23 +61,18 @@ To configure the `UrlAdaptor`, set the [Adaptor](https://help.syncfusion.com/cr/
6461
public class EmployeeData
6562
{
6663
public int EmployeeID { get; set; }
67-
public string Name { get; set; }
68-
public string Title { get; set; }
64+
public string EmployeeName { get; set; }
65+
public string Designation { get; set; }
6966
}
70-
7167
}
7268
7369
```
7470

75-
N> Replace sample URL with the actual service endpoint URL.
76-
7771
The server response must include two properties:
7872

7973
* **result** – A collection of entities.
8074
* **count** – The total number of records.
8175

82-
**Sample Response**
83-
8476
```
8577
{
8678
"result": [{...}, {...}, {...}],
@@ -127,8 +119,6 @@ To configure, set the [Adaptor](https://help.syncfusion.com/cr/blazor/Syncfusion
127119
}
128120
```
129121

130-
N> `ODataAdaptor` is the default adaptor used by `SfDataManager`.
131-
132122
## ODataV4 adaptor
133123

134124
The `ODataV4Adaptor` enables integration with services that implement the OData v4 protocol. It provides standardized communication between the [SfDataManager](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Data.SfDataManager.html) component and OData v4-compliant endpoints. This adaptor automatically generates query parameters for common data operations, reducing manual configuration.
@@ -241,7 +231,7 @@ The GraphQL response must return a JSON-formatted response with properties:
241231
@using Syncfusion.Blazor.Grids
242232
243233
<SfGrid TValue="Order" AllowPaging="true" PageSettings="new PageSettings { PageSize = 10 }">
244-
<SfDataManager Url="https://your-graphql-endpoint"
234+
<SfDataManager Url="https://api.example.com/graphql"
245235
GraphQLAdaptorOptions="@adaptorOptions"
246236
Adaptor="Adaptors.GraphQLAdaptor">
247237
</SfDataManager>
@@ -282,6 +272,7 @@ The GraphQL response must return a JSON-formatted response with properties:
282272
}
283273
284274
```
275+
N> Replace sample URL with the actual service endpoint URL.
285276

286277
### Performing data operations
287278

@@ -848,7 +839,7 @@ N> The complete implementation is available in the [GitHub](https://github.com/S
848839

849840
When the built-in adaptors do not meet specific requirements, a **custom adaptor** can be implemented.
850841

851-
Steps to create and use a custom adaptor:
842+
**Steps to create and use a custom adaptor**:
852843

853844
1. Create a class that inherits from the [DataAdaptor](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.DataAdaptor.html) base class.
854845
2. Override the required methods to implement the desired functionality.

0 commit comments

Comments
 (0)