Class AdaptorBase
Base class for all data adaptors.
Inherited Members
Namespace: Syncfusion.Blazor.Data
Assembly: Syncfusion.Blazor.dll
Syntax
public class AdaptorBase
Constructors
AdaptorBase(DataManager)
Declaration
public AdaptorBase(DataManager dataManager)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager |
Properties
DataManager
Specifies the data manager instance.
Declaration
public DataManager DataManager { get; set; }
Property Value
| Type |
|---|
| DataManager |
RunSyncOnce
When true, runs data operation synchronously. Applicable only for BlazorAdaptor.
Declaration
public bool RunSyncOnce { get; set; }
Property Value
| Type |
|---|
| bool |
Methods
AddParams(RequestOptions, DataManagerRequest)
Adds additional paramerters from Query instance to server request.
Declaration
public virtual void AddParams(RequestOptions options, DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options | |
| DataManagerRequest | queries |
BatchUpdate(DataManager, List<IDynamicMetaObjectProvider>, List<IDynamicMetaObjectProvider>, List<IDynamicMetaObjectProvider>, Utils, string, int?, Query, object)
Handles the batch update operation for Dynamic objects. Enables user to perform add, update and remove items from data source in a single request.
Declaration
public virtual 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 instance. |
| List<IDynamicMetaObjectProvider> | changed | Specifies the changed records. |
| List<IDynamicMetaObjectProvider> | added | Specifies the added records. |
| List<IDynamicMetaObjectProvider> | deleted | Specifies the deleted records. |
| Utils | e | Specifies the url and its key. |
| string | keyField | Specifies the primary key field. |
| int? | dropIndex | Specifies the record position, from which new records will be added. |
| Query | query | Query class instance. |
| object | original | Specifies the original data. Uses this original data for sending change items alone to the server. |
Returns
| Type | Description |
|---|---|
| object | object. |
BatchUpdate(DataManager, object, object, object, Utils, string, int?, Query, object)
Handles the batch update operation. Enables user to perform add, update and remove items from data source in a single request.
Declaration
public virtual 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 instance. |
| object | changed | Specifies the changed records. |
| object | added | Specifies the added records. |
| object | deleted | Specifies the deleted records. |
| Utils | e | Specifies the url and its key. |
| string | keyField | Specifies the primary key field. |
| int? | dropIndex | Specifies the record position, from which new records will be added. |
| Query | query | Query class instance. |
| object | original | Specifies the original data. Uses this original data for sending change items alone to the server. |
Returns
| Type | Description |
|---|---|
| object | object. |
BeforeSend(HttpRequestMessage)
Invoked before sending server request.
Declaration
public virtual void BeforeSend(HttpRequestMessage request)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpRequestMessage | request | Specifies the HttpRequestMessage instance. |
GetModelType()
To get model type.
Declaration
public virtual Type GetModelType()
Returns
| Type |
|---|
| Type |
GetName()
Returns the adaptor name.
Declaration
public virtual string GetName()
Returns
| Type | Description |
|---|---|
| string | string. |
Insert(DataManager, IDynamicMetaObjectProvider, string, Query, int)
Handles the new item add operation in dynamic objects.
Declaration
public virtual object Insert(DataManager dataManager, IDynamicMetaObjectProvider data, string tableName = null, Query query = null, int position = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager instance. |
| IDynamicMetaObjectProvider | data | New item to be added. |
| string | tableName | Table name to insert new item. |
| Query | query | Query class instance. |
| int | position | Position to insert the new item. |
Returns
| Type | Description |
|---|---|
| object | object. |
Insert(DataManager, object, string, Query, int)
Handles the new item add operation.
Declaration
public virtual object Insert(DataManager dataManager, object data, string tableName = null, Query query = null, int position = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager instance. |
| object | data | New item to be added. |
| string | tableName | Table name to insert new item. |
| Query | query | Query class instance. |
| int | position | Position to insert the new item. |
Returns
| Type | Description |
|---|---|
| object | object. |
IsRemote()
Returns true if data source is remote service.
Declaration
public virtual bool IsRemote()
Returns
| Type | Description |
|---|---|
| bool | bool. |
PerformDataOperation<T>(object)
Performs data operation. If its a remote data source then make a server request.
Declaration
public virtual Task<object> PerformDataOperation<T>(object queries)
Parameters
| Type | Name | Description |
|---|---|---|
| object | queries | Specifies the query. |
Returns
| Type | Description |
|---|---|
| Task<object> | Task. |
Type Parameters
| Name | Description |
|---|---|
| T | Specifies the data source model type. |
ProcessBatchResponse<T>(object, DataManagerRequest)
Process the data operation batch response/result from the data source and make it understandable by user end.
Declaration
public virtual Task<object> ProcessBatchResponse<T>(object data, DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| object | data | Specifies the data. |
| DataManagerRequest | queries | Specifies the query. |
Returns
| Type | Description |
|---|---|
| Task<object> | Task. |
Type Parameters
| Name | Description |
|---|---|
| T | Specifies the data source model type. |
ProcessCrudResponse<T>(object, DataManagerRequest)
Process the CRUD operation response/result from the data source and make it understandable by user end.
Declaration
public virtual Task<object> ProcessCrudResponse<T>(object data, DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| object | data | Specifies the data manager instance. |
| DataManagerRequest | queries | Specifies the query. |
Returns
| Type | Description |
|---|---|
| Task<object> | Task. |
Type Parameters
| Name | Description |
|---|---|
| T | Specifies the data source model type. |
ProcessQuery(DataManagerRequest)
Read query from Query and make it understandable by data source.
Declaration
public virtual object ProcessQuery(DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManagerRequest | queries | Specifies the query. |
Returns
| Type | Description |
|---|---|
| object | object. |
ProcessResponse<T>(object, DataManagerRequest)
Process the data operation response/result from the data source and make it understandable by user end.
Declaration
public virtual Task<object> ProcessResponse<T>(object data, DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| object | data | Specifies the data manager instance. |
| DataManagerRequest | queries | Specifies the query. |
Returns
| Type | Description |
|---|---|
| Task<object> | Task. |
Type Parameters
| Name | Description |
|---|---|
| T | Specifies the data source model type. |
Remove(DataManager, string, object, string, Query)
Handles the remove operation.
Declaration
public virtual object Remove(DataManager dataManager, string keyField, object value, string tableName = null, Query query = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager instance. |
| string | keyField | Specifies the primary key. |
| object | value | Specifies the primary key field value. |
| string | tableName | Table name of the update item. |
| Query | query | Query instance. |
Returns
| Type | Description |
|---|---|
| object | object. |
SetModelType(Type)
To get model type.
Declaration
public virtual void SetModelType(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type |
SetRunSyncOnce(bool)
Runs the data operation synchronously.
Declaration
public virtual void SetRunSyncOnce(bool runSync)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | runSync | Enables synchronous data operation. |
Update(DataManager, string, IDynamicMetaObjectProvider, string, Query, object)
Handles the item update operation.
Declaration
public virtual object Update(DataManager dataManager, string keyField, IDynamicMetaObjectProvider data, string tableName = null, Query query = null, object original = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager | DataManager instance. |
| string | keyField | Specifies the primary key. |
| IDynamicMetaObjectProvider | data | Specifies the updated record. |
| string | tableName | Table name of the update item. |
| Query | query | Query instance. |
| object | original | Specifies the original data. Uses this original data for sending change items alone to the server. |
Returns
| Type | Description |
|---|---|
| object | object. |
Update(DataManager, string, object, string, Query, object, IDictionary<string, object>)
Handles the item update operation.
Declaration
public virtual 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 instance. |
| string | keyField | Specifies the primary key. |
| object | data | Specifies the updated record. |
| string | tableName | Table name of the update item. |
| Query | query | Query instance. |
| object | original | Specifies the original data. Uses this original data for sending change items alone to the server. |
| IDictionary<string, object> | updateProperties | Specifies the field names to be updated. |
Returns
| Type | Description |
|---|---|
| object | object. |