Class AdaptorBase
Base class for all data adaptors.
Namespace: Syncfusion.Blazor.Data
Assembly: Syncfusion.Blazor.dll
Syntax
public class AdaptorBase : Object, IAdaptor
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 |
---|
System.Boolean |
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, Nullable<Int32>, 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, Nullable<int> dropIndex, Query query = null, object original = null)
Parameters
Type | Name | Description |
---|---|---|
DataManager | dataManager | DataManager instance. |
System.Collections.Generic.List<System.Dynamic.IDynamicMetaObjectProvider> | changed | Specifies the changed records. |
System.Collections.Generic.List<System.Dynamic.IDynamicMetaObjectProvider> | added | Specifies the added records. |
System.Collections.Generic.List<System.Dynamic.IDynamicMetaObjectProvider> | deleted | Specifies the deleted records. |
Utils | e | Specifies the url and its key. |
System.String | keyField | Specifies the primary key field. |
System.Nullable<System.Int32> | dropIndex | Specifies the record position, from which new records will be added. |
Query | query | Query class instance. |
System.Object | original | Specifies the original data. Uses this original data for sending change items alone to the server. |
Returns
Type | Description |
---|---|
System.Object | object. |
BatchUpdate(DataManager, Object, Object, Object, Utils, String, Nullable<Int32>, 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, Nullable<int> dropIndex, Query query = null, object original = null)
Parameters
Type | Name | Description |
---|---|---|
DataManager | dataManager | DataManager instance. |
System.Object | changed | Specifies the changed records. |
System.Object | added | Specifies the added records. |
System.Object | deleted | Specifies the deleted records. |
Utils | e | Specifies the url and its key. |
System.String | keyField | Specifies the primary key field. |
System.Nullable<System.Int32> | dropIndex | Specifies the record position, from which new records will be added. |
Query | query | Query class instance. |
System.Object | original | Specifies the original data. Uses this original data for sending change items alone to the server. |
Returns
Type | Description |
---|---|
System.Object | object. |
BeforeSend(HttpRequestMessage)
Invoked before sending server request.
Declaration
public virtual void BeforeSend(HttpRequestMessage request)
Parameters
Type | Name | Description |
---|---|---|
System.Net.Http.HttpRequestMessage | request | Specifies the HttpRequestMessage instance. |
GetModelType()
To get model type.
Declaration
public virtual Type GetModelType()
Returns
Type |
---|
System.Type |
GetName()
Returns the adaptor name.
Declaration
public virtual string GetName()
Returns
Type | Description |
---|---|
System.String | string. |
Insert(DataManager, IDynamicMetaObjectProvider, String, Query, Int32)
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. |
System.Dynamic.IDynamicMetaObjectProvider | data | New item to be added. |
System.String | tableName | Table name to insert new item. |
Query | query | Query class instance. |
System.Int32 | position | Position to insert the new item. |
Returns
Type | Description |
---|---|
System.Object | object. |
Insert(DataManager, Object, String, Query, Int32)
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. |
System.Object | data | New item to be added. |
System.String | tableName | Table name to insert new item. |
Query | query | Query class instance. |
System.Int32 | position | Position to insert the new item. |
Returns
Type | Description |
---|---|
System.Object | object. |
IsRemote()
Returns true if data source is remote service.
Declaration
public virtual bool IsRemote()
Returns
Type | Description |
---|---|
System.Boolean | 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 |
---|---|---|
System.Object | queries | Specifies the query. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.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 |
---|---|---|
System.Object | data | Specifies the data. |
DataManagerRequest | queries | Specifies the query. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.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 |
---|---|---|
System.Object | data | Specifies the data manager instance. |
DataManagerRequest | queries | Specifies the query. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.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 |
---|---|
System.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 |
---|---|---|
System.Object | data | Specifies the data manager instance. |
DataManagerRequest | queries | Specifies the query. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.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. |
System.String | keyField | Specifies the primary key. |
System.Object | value | Specifies the primary key field value. |
System.String | tableName | Table name of the update item. |
Query | query | Query instance. |
Returns
Type | Description |
---|---|
System.Object | object. |
SetModelType(Type)
To get model type.
Declaration
public virtual void SetModelType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type |
SetRunSyncOnce(Boolean)
Runs the data operation synchronously.
Declaration
public virtual void SetRunSyncOnce(bool runSync)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | 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. |
System.String | keyField | Specifies the primary key. |
System.Dynamic.IDynamicMetaObjectProvider | data | Specifies the updated record. |
System.String | tableName | Table name of the update item. |
Query | query | Query instance. |
System.Object | original | Specifies the original data. Uses this original data for sending change items alone to the server. |
Returns
Type | Description |
---|---|
System.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. |
System.String | keyField | Specifies the primary key. |
System.Object | data | Specifies the updated record. |
System.String | tableName | Table name of the update item. |
Query | query | Query instance. |
System.Object | original | Specifies the original data. Uses this original data for sending change items alone to the server. |
System.Collections.Generic.IDictionary<System.String, System.Object> | updateProperties | Specifies the field names to be updated. |
Returns
Type | Description |
---|---|
System.Object | object. |