Class DataAdaptor
Abstract class for Data adaptors.
Inherited Members
Namespace: Syncfusion.Blazor
Assembly: Syncfusion.Blazor.Data.dll
Syntax
public abstract class DataAdaptor : OwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IDataAdaptor
Remarks
Extend DataAdaptor component while creating custom adaptor component. DataAdaptor component is extended from OwningComponentBase so that services can be accessed from ScopedServices property.
Constructors
DataAdaptor()
Declaration
protected DataAdaptor()
Methods
BatchUpdate(DataManager, object, object, object, IReadOnlyList<string>, string, int?)
Performs add, update, and remove operations on multiple records in a single request.
Declaration
public virtual object BatchUpdate(DataManager dataManager, object changedRecords, object addedRecords, object deletedRecords, IReadOnlyList<string> primaryColumnNames, string key, int? dropIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | The Syncfusion.Blazor.DataAdaptor.DataManager instance that manages data operations. |
| object | changedRecords | The collection of records that contain modifications to apply to the data source. |
| object | addedRecords | The collection of new records to insert into the data source. |
| object | deletedRecords | The collection of records to remove from the data source. |
| IReadOnlyList<string> | primaryColumnNames | The collection of field names that uniquely identify records. |
| string | key | The key that identifies the batch operation. |
| int? | dropIndex | The index at which newly added records are inserted. |
Returns
| Type | Description |
|---|---|
| object | The result of the batch operation. |
BatchUpdate(DataManager, object, object, object, string, string, int?)
Performs Batch CRUD operations synchronously.
Declaration
public virtual object BatchUpdate(DataManager dataManager, object changedRecords, object addedRecords, object deletedRecords, string primaryColumnName, string key, int? dropIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | |
| object | changedRecords | |
| object | addedRecords | |
| object | deletedRecords | |
| string | primaryColumnName | |
| string | key | |
| int? | dropIndex |
Returns
| Type |
|---|
| object |
BatchUpdateAsync(DataManager, object, object, object, IReadOnlyList<string>, string, int?)
Performs add, update, and remove operations on multiple records in a single request.
Declaration
public virtual Task<object> BatchUpdateAsync(DataManager dataManager, object changedRecords, object addedRecords, object deletedRecords, IReadOnlyList<string> primaryColumnNames, string key, int? dropIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | The Syncfusion.Blazor.DataAdaptor.DataManager instance that manages data operations. |
| object | changedRecords | The collection of records that contain modifications to apply to the data source. |
| object | addedRecords | The collection of new records to insert into the data source. |
| object | deletedRecords | The collection of records to remove from the data source. |
| IReadOnlyList<string> | primaryColumnNames | The collection of field names that uniquely identify records. |
| string | key | The key that identifies the batch operation. |
| int? | dropIndex | The index at which newly added records are inserted. |
Returns
| Type | Description |
|---|---|
| Task<object> | A task that represents the asynchronous batch operation. |
BatchUpdateAsync(DataManager, object, object, object, string, string, int?)
Performs Batch CRUD operations asynchronously.
Declaration
public virtual Task<object> BatchUpdateAsync(DataManager dataManager, object changedRecords, object addedRecords, object deletedRecords, string primaryColumnName, string key, int? dropIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | |
| object | changedRecords | |
| object | addedRecords | |
| object | deletedRecords | |
| string | primaryColumnName | |
| string | key | |
| int? | dropIndex |
Returns
| Type |
|---|
| Task<object> |
Insert(DataManager, object, string)
Inserts a new data item into the data collection.
Declaration
public virtual object Insert(DataManager dataManager, object record, string additionalParam)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | The DataManager is a data management component used for performing data operations in applications. |
| object | record | The new record which is need to be inserted. |
| string | additionalParam | An optional parameter that can be used to perform additional data operations. |
Returns
| Type | Description |
|---|---|
| object | Returns the newly inserted record details. |
InsertAsync(DataManager, object, string)
Inserts a new data item into the data collection.
Declaration
public virtual Task<object> InsertAsync(DataManager dataManager, object record, string additionalParam)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | The DataManager is a data management component used for performing data operations in applications. |
| object | record | The new record which is need to be inserted. |
| string | additionalParam | An optional parameter that can be used to perform additional data operations. |
Returns
| Type | Description |
|---|---|
| Task<object> | Returns the newly inserted record details. |
OnInitializedAsync()
Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree. Initializes the data adaptor instance and sets the parent component if a custom adaptor instance is not provided.
Declaration
protected override Task OnInitializedAsync()
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |
Overrides
Read(DataManagerRequest, string)
Returns the data collection after performing data operations based on request from DataManagerRequest
Declaration
public virtual object Read(DataManagerRequest dataManagerRequest, string additionalParam = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManagerRequest | dataManagerRequest | DataManagerRequest containes the information regarding paging, grouping, filtering, searching which is handled on the DataGrid component side |
| string | additionalParam | An optional parameter that can be used to perform additional data operations. |
Returns
| Type | Description |
|---|---|
| object | The data collection's type is determined by how this method has been implemented. |
ReadAsync(DataManagerRequest, string)
Returns the data collection after performing data operations based on request from DataManagerRequest
Declaration
public virtual Task<object> ReadAsync(DataManagerRequest dataManagerRequest, string additionalParam = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManagerRequest | dataManagerRequest | DataManagerRequest containes the information regarding paging, grouping, filtering, searching which is handled on the DataGrid component side |
| string | additionalParam | An optional parameter that can be used to perform additional data operations. |
Returns
| Type | Description |
|---|---|
| Task<object> | The data collection's type is determined by how this method has been implemented. |
Remove(DataManager, IDictionary<string, object?>, string)
Removes a record from the data source.
Declaration
public virtual object Remove(DataManager dataManager, IDictionary<string, object?> keyValues, string additionalParam)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | The Syncfusion.Blazor.DataAdaptor.DataManager instance that manages data operations. |
| IDictionary<string, object> | keyValues | A dictionary containing the field names and values that uniquely identify the record to remove. |
| string | additionalParam | Additional information that can be used to perform custom data operations. |
Returns
| Type | Description |
|---|---|
| object | The removed record. |
Remove(DataManager, object, string, string)
Removes a data item from the data collection.
Declaration
public virtual object Remove(DataManager dataManager, object primaryColumnValue, string primaryColumnName, string additionalParam)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | The DataManager is a data management component used for performing data operations in applications. |
| object | primaryColumnValue | The primaryColumnValue specifies the primary column value which is needs to be removed from the grid record. |
| string | primaryColumnName | The primaryColumnName specifies the field name of the primary column. |
| string | additionalParam | An optional parameter that can be used to perform additional data operations. |
Returns
| Type | Description |
|---|---|
| object | Returns the removed data item. |
RemoveAsync(DataManager, IDictionary<string, object?>, string)
Removes a record from the data source.
Declaration
public virtual Task<object> RemoveAsync(DataManager dataManager, IDictionary<string, object?> keyValues, string additionalParam)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | The Syncfusion.Blazor.DataAdaptor.DataManager instance that manages data operations. |
| IDictionary<string, object> | keyValues | A dictionary containing the field names and values that uniquely identify the record to remove. |
| string | additionalParam | Additional information that can be used to perform custom data operations. |
Returns
| Type | Description |
|---|---|
| Task<object> | A task that represents the asynchronous remove operation. |
RemoveAsync(DataManager, object, string, string)
Removes a data item from the data collection.
Declaration
public virtual Task<object> RemoveAsync(DataManager dataManager, object primaryColumnValue, string primaryColumnName, string additionalParam)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | The DataManager is a data management component used for performing data operations in applications. |
| object | primaryColumnValue | The primaryColumnValue specifies the primary column value which is needs to be removed from the grid record. |
| string | primaryColumnName | The primaryColumnName specifies the field name of the primary column. |
| string | additionalParam | An optional parameter that can be used to perform additional data operations. |
Returns
| Type | Description |
|---|---|
| Task<object> | Returns the removed data item. |
SetParent(BaseComponent)
Sets the parent BaseComponent for the data adaptor.
Declaration
public void SetParent(BaseComponent parent)
Parameters
| Type | Name | Description |
|---|---|---|
| BaseComponent | parent | The parent BaseComponent instance to be associated with this adaptor. |
Update(DataManager, object, IReadOnlyList<string>, string)
Updates an existing data item in the data collection.
Declaration
public virtual object Update(DataManager dataManager, object record, IReadOnlyList<string> keyFields, string additionalParam)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | The DataManager is a data management component used for performing data operations in applications. |
| object | record | The modified record which is need to be updated. |
| IReadOnlyList<string> | keyFields | The key field names of the entity to update. |
| string | additionalParam | An optional parameter that can be used to perform additional data operations. |
Returns
| Type | Description |
|---|---|
| object | Returns the updated data item. |
Update(DataManager, object, string, string)
Updates an existing data item in the data collection.
Declaration
public virtual object Update(DataManager dataManager, object record, string primaryColumnName, string additionalParam)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | The DataManager is a data management component used for performing data operations in applications. |
| object | record | The modified record which is need to be updated. |
| string | primaryColumnName | The primaryColumnName specifies the field name of the primary column. |
| string | additionalParam | An optional parameter that can be used to perform additional data operations. |
Returns
| Type | Description |
|---|---|
| object | Returns the updated data item. |
UpdateAsync(DataManager, object, IReadOnlyList<string>, string)
Updates an existing data item in the data collection.
Declaration
public virtual Task<object> UpdateAsync(DataManager dataManager, object record, IReadOnlyList<string> keyFields, string additionalParam)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | The DataManager is a data management component used for performing data operations in applications. |
| object | record | The modified record which is need to be updated. |
| IReadOnlyList<string> | keyFields | The key field names of the entity to update. |
| string | additionalParam | An optional parameter that can be used to perform additional data operations. |
Returns
| Type | Description |
|---|---|
| Task<object> | Returns the updated data item. |
UpdateAsync(DataManager, object, string, string)
Updates an existing data item in the data collection.
Declaration
public virtual Task<object> UpdateAsync(DataManager dataManager, object record, string primaryColumnName, string additionalParam)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | The DataManager is a data management component used for performing data operations in applications. |
| object | record | The modified record which is need to be updated. |
| string | primaryColumnName | The primaryColumnName specifies the field name of the primary column. |
| string | additionalParam | An optional parameter that can be used to perform additional data operations. |
Returns
| Type | Description |
|---|---|
| Task<object> | Returns the updated data item. |