Class BlazorAdaptor
Handles data operation in IEnumerable data source.
Inherited Members
Namespace: Syncfusion.Blazor.Data
Assembly: Syncfusion.Blazor.dll
Syntax
public class BlazorAdaptor : AdaptorBase
Constructors
BlazorAdaptor(DataManager)
Initializes a new instance of the BlazorAdaptor class with the specified DataManager.
Declaration
public BlazorAdaptor(DataManager dataManager)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager |
Methods
BatchUpdate(DataManager, List<IDynamicMetaObjectProvider>, List<IDynamicMetaObjectProvider>, List<IDynamicMetaObjectProvider>, Utils, string, int?, Query, object)
Performs batch update, insert, and delete on dynamic objects in the data source.
Declaration
public override object BatchUpdate(DataManager dataManager, List<IDynamicMetaObjectProvider> changed, List<IDynamicMetaObjectProvider> added, List<IDynamicMetaObjectProvider> deleted, Utils e, string keyField, int? dropIndex, Query query = null, object original = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager context. |
| List<IDynamicMetaObjectProvider> | changed | List of modified dynamic records. |
| List<IDynamicMetaObjectProvider> | added | List of newly added dynamic records. |
| List<IDynamicMetaObjectProvider> | deleted | List of dynamic records to delete. |
| Utils | e | Utility info containing URL/key context. |
| string | keyField | Field name used as the record key. |
| int? | dropIndex | Index for insertion of new records. |
| Query | query | Query context and parameters.This parameter is optional. |
| object | original | Original data used for comparison.This parameter is optional. |
Returns
| Type | Description |
|---|---|
| object | Returns an object containing changedRecords, addedRecords, and deletedRecords. |
Overrides
BatchUpdate(DataManager, object, object, object, Utils, string, int?, Query, object)
Performs batch update, insert, and delete operations on the data source.
Declaration
public override object BatchUpdate(DataManager dataManager, object changed, object added, object deleted, Utils e, string keyField, int? dropIndex, Query query = null, object original = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager containing the data source. |
| object | changed | Collection of modified records. |
| object | added | Collection of newly added records. |
| object | deleted | Collection of records to delete. |
| Utils | e | Utility object containing additional info. |
| string | keyField | Key field name identifying records. |
| int? | dropIndex | Index for insertion. |
| Query | query | Query context.This parameter is optional. |
| object | original | Original data context.This parameter is optional. |
Returns
| Type | Description |
|---|---|
| object | Returns an object containing changedRecords, addedRecords, and deletedRecords. |
Overrides
BatchUpdateArray<T>(DataManager, object, object, object, string, int?)
Performs batch update, insert, and delete operations on an array-based data source.
Declaration
public static object BatchUpdateArray<T>(DataManager dataManager, object changed, object added, object deleted, string keyField, int? dropIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager containing the data source. |
| object | changed | Collection of modified records. |
| object | added | Collection of newly added records. |
| object | deleted | Collection of records to delete. |
| string | keyField | Key field name identifying records. |
| int? | dropIndex | Index for insertion. |
Returns
| Type | Description |
|---|---|
| object | Returns an object containing changedRecords, addedRecords, and deletedRecords. |
Type Parameters
| Name |
|---|
| T |
CollectChildRecords(IEnumerable, DataManagerRequest)
Performs data operation on child records.
Declaration
public static IEnumerable CollectChildRecords(IEnumerable datasource, DataManagerRequest dm)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable | datasource | Data source value. |
| DataManagerRequest | dm | Query to be processed. |
Returns
| Type | Description |
|---|---|
| IEnumerable | IEnumerable. |
DataOperationInvoke<T>(IEnumerable, DataManagerRequest)
Performs data operation.
Declaration
public static DataResult DataOperationInvoke<T>(IEnumerable dataSource, DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable | dataSource | Data source value. |
| DataManagerRequest | queries | Query to be processed. |
Returns
| Type | Description |
|---|---|
| DataResult | DataResult. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of the data source item. |
GetName()
Gets the adaptor name.
Declaration
public override string GetName()
Returns
| Type | Description |
|---|---|
| string | The adaptor name. |
Overrides
GroupResult<T>(DataManagerRequest, IEnumerable, DataResult)
Groups the data source based on the specified query and updates the DataResult with grouped data.
Declaration
public static DataResult GroupResult<T>(DataManagerRequest queries, IEnumerable DataSource, DataResult DataObject)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManagerRequest | queries | DataManager request containing grouping details. |
| IEnumerable | DataSource | Data source value. |
| DataResult | DataObject | DataResult object to update with grouped data. |
Returns
| Type | Description |
|---|---|
| DataResult | A DataResult containing the grouped data and count. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the data items. |
Insert(DataManager, IDynamicMetaObjectProvider, string, Query, int)
Inserts a dynamic object into the data source at the specified position, ensuring type consistency.
Declaration
public override object Insert(DataManager dataManager, IDynamicMetaObjectProvider data, string tableName = null, Query query = null, int position = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager containing the data source. |
| IDynamicMetaObjectProvider | data | Dynamic object to insert. |
| string | tableName | Target table name.This parameter is optional. |
| Query | query | Query context.This parameter is optional. |
| int | position | Position at which to insert the record.This parameter is optional. |
Returns
| Type | Description |
|---|---|
| object | Returns the inserted record as a string. |
Overrides
Insert(DataManager, object, string, Query, int)
Inserts a new record into the data source at the given position.
Declaration
public override object Insert(DataManager dataManager, object data, string tableName = null, Query query = null, int position = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager containing the data source. |
| object | data | Record to insert. |
| string | tableName | Target table name.This parameter is optional. |
| Query | query | Query context and parameters.This parameter is optional. |
| int | position | Position at which to insert the record.This parameter is optional. |
Returns
| Type | Description |
|---|---|
| object | Returns the inserted record object. |
Overrides
InsertArray<T>(DataManager, object, int)
Inserts a new record into an array-based data source at the given position.
Declaration
public static object InsertArray<T>(DataManager dataManager, object data, int position)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager containing the data source. |
| object | data | Record to insert. |
| int | position | Position at which to insert the record. |
Returns
| Type | Description |
|---|---|
| object | Returns the inserted record object. |
Type Parameters
| Name |
|---|
| T |
PerformDataOperation<T>(object)
Performs filtering, sorting, and paging on the data source.
Declaration
public override Task<object> PerformDataOperation<T>(object queries)
Parameters
| Type | Name | Description |
|---|---|---|
| object | queries | DataManager request containing query operations |
Returns
| Type | Description |
|---|---|
| Task<object> | Returns the operation result or the processed data based on the query. |
Type Parameters
| Name |
|---|
| T |
Overrides
ProcessQuery(DataManagerRequest)
Processes the data request and returns API options.
Declaration
public override object ProcessQuery(DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManagerRequest | queries | Data Manager request. |
Returns
| Type | Description |
|---|---|
| object | The DataManagerRequest object. |
Overrides
ProcessResponse<T>(object, DataManagerRequest)
Processes response data based on the query and returns the appropriate result.
Declaration
public override Task<object> ProcessResponse<T>(object data, DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| object | data | Source data to process. |
| DataManagerRequest | queries | DataManager request. |
Returns
| Type | Description |
|---|---|
| Task<object> | Returns DataResult, Group collection, or List based on the query. |
Type Parameters
| Name |
|---|
| T |
Overrides
Remove(DataManager, string, object, string, Query)
Removes a record from the data source using the specified key field.
Declaration
public override object Remove(DataManager dataManager, string keyField, object value, string tableName = null, Query query = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager containing the data source. |
| string | keyField | Key field name identifying the record. |
| object | value | Key value of the record to remove. |
| string | tableName | Target table name.This parameter is optional. |
| Query | query | Query context and parameters.This parameter is optional. |
Returns
| Type | Description |
|---|---|
| object | Returns the removed key value. |
Overrides
RemoveArray<T>(DataManager, string, object)
Removes a record from an array-based data source based on the specified key field.
Declaration
public static object RemoveArray<T>(DataManager dataManager, string keyField, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager containing the data source. |
| string | keyField | Key field name identifying the record. |
| object | value | Key value of the record to remove. |
Returns
| Type |
|---|
| object |
Type Parameters
| Name |
|---|
| T |
SetRunSyncOnce(bool)
Sets a flag to run the next data operation synchronously.
Enables synchronous data operation.Declaration
public override void SetRunSyncOnce(bool runSync)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | runSync |
Overrides
Update(DataManager, string, IDynamicMetaObjectProvider, string, Query, object)
Updates an existing dynamic object in the data source based on the specified key field.
Declaration
public override object Update(DataManager dataManager, string keyField, IDynamicMetaObjectProvider data, string tableName = null, Query query = null, object original = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | Data manager containing the data source. |
| string | keyField | Key field name identifying the record. |
| IDynamicMetaObjectProvider | data | Dynamic object with updated values. |
| string | tableName | Target table name.This parameter is optional. |
| Query | query | Query context.This parameter is optional. |
| object | original | Original dynamic object before updates.This parameter is optional. |
Returns
| Type | Description |
|---|---|
| object | Returns the updated dynamic object. |
Overrides
Update(DataManager, string, object, string, Query, object, IDictionary<string, object>)
Updates an existing record by matching the key field and applying new values.
Declaration
public override object Update(DataManager dataManager, string keyField, object data, string tableName = null, Query query = null, object original = null, IDictionary<string, object> updateProperties = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager containing the data source. |
| string | keyField | Key field name identifying the record. |
| object | data | Record with updated values. |
| string | tableName | Target table name.This parameter is optional. |
| Query | query | Query context and parameters.This parameter is optional. |
| object | original | Original record before updates.This parameter is optional. |
| IDictionary<string, object> | updateProperties | Properties to update when provided.This parameter is optional. |
Returns
| Type | Description |
|---|---|
| object | Returns the updated record object. |