Class ODataAdaptor
Handles request and response to and from OData service.
Inherited Members
Namespace: Syncfusion.Blazor.Data
Assembly: Syncfusion.Blazor.dll
Syntax
public class ODataAdaptor : AdaptorBase
Constructors
ODataAdaptor(DataManager)
Declaration
public ODataAdaptor(DataManager dataManager)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager |
Properties
Options
Declaration
public RemoteOptions Options { get; set; }
Property Value
| Type |
|---|
| RemoteOptions |
ResourceTableName
Declaration
public string ResourceTableName { get; set; }
Property Value
| Type |
|---|
| string |
Methods
AddParams(RequestOptions, DataManagerRequest)
Adds additional paramerters from Query instance to server request.
Declaration
public override void AddParams(RequestOptions options, DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| RequestOptions | options | |
| DataManagerRequest | queries |
Overrides
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 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 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. |
Overrides
BeforeSend(HttpRequestMessage)
Invoked before sending server request.
Declaration
public override void BeforeSend(HttpRequestMessage request)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpRequestMessage | request | Specifies the HttpRequestMessage instance. |
Overrides
CheckDate(string)
Check if given value is a valid date or not.
Declaration
protected static bool CheckDate(string date)
Parameters
| Type | Name | Description |
|---|---|---|
| string | date | Input date string. |
Returns
| Type | Description |
|---|---|
| bool | bool. |
GetModelType()
To get model type.
Declaration
public override Type GetModelType()
Returns
| Type |
|---|
| Type |
Overrides
GetName()
Returns the adaptor name.
Declaration
public override string GetName()
Returns
| Type | Description |
|---|---|
| string | string. |
Overrides
Insert(DataManager, object, string, Query, int)
Handles the new item add operation.
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 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. |
Overrides
IsRemote()
Returns true if data source is remote service.
Declaration
public override bool IsRemote()
Returns
| Type | Description |
|---|---|
| bool | bool. |
Overrides
OnCount(bool)
Returns count query string based on query.
Declaration
public virtual string OnCount(bool e)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | e | Request count value if it is true. |
Returns
| Type | Description |
|---|---|
| string | string. |
OnDistinct(List<string>)
Returns distinct query string based on query.
Declaration
public virtual string OnDistinct(List<string> distincts)
Parameters
| Type | Name | Description |
|---|---|---|
| List<string> | distincts | List of field names. |
Returns
| Type | Description |
|---|---|
| string | string. |
Remarks
Applicable only for ODataV4 services.
OnEachSearch(SearchFilter)
Returns search query string based on query.
Declaration
public virtual void OnEachSearch(SearchFilter e)
Parameters
| Type | Name | Description |
|---|---|---|
| SearchFilter | e | Search query. |
OnEachSort(DataManagerRequest)
Returns sort query string based on query.
Declaration
public static string OnEachSort(DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManagerRequest | queries | Query value. |
Returns
| Type | Description |
|---|---|
| string | string. |
OnExpand(List<string>)
Returns expand query string based on query.
Declaration
public static string OnExpand(List<string> expands)
Parameters
| Type | Name | Description |
|---|---|---|
| List<string> | expands | List of relational table names. |
Returns
| Type | Description |
|---|---|
| string | string. |
OnExpand(List<string>, List<string>)
Returns expand query string based on query.
Declaration
public virtual string OnExpand(List<string> selects, List<string> expands)
Parameters
| Type | Name | Description |
|---|---|---|
| List<string> | selects | List of fields to select in relational tables. |
| List<string> | expands | List of relational table names. |
Returns
| Type | Description |
|---|---|
| string | string. |
OnPredicate(WhereFilter, DataManagerRequest, bool)
Generates request filter query string from the Query value.
Declaration
public virtual string OnPredicate(WhereFilter filter, DataManagerRequest query, bool requiresCast = false)
Parameters
| Type | Name | Description |
|---|---|---|
| WhereFilter | filter | Filter criteria. |
| DataManagerRequest | query | Query value. |
| bool | requiresCast | Performs value cast. Applicable on search operation. |
Returns
| Type |
|---|
| string |
OnSearch(List<WhereFilter>)
Returns search query string based on query.
Declaration
public virtual void OnSearch(List<WhereFilter> e)
Parameters
| Type | Name | Description |
|---|---|---|
| List<WhereFilter> | e | List of filter queries. |
OnSearch(List<WhereFilter>, object)
Returns search query string based on query.
Declaration
public virtual string OnSearch(List<WhereFilter> e, object additionParams = null)
Parameters
| Type | Name | Description |
|---|---|---|
| List<WhereFilter> | e | List of filter queries. |
| object | additionParams | Additional parameters. |
Returns
| Type | Description |
|---|---|
| string | string. |
OnSelect(List<string>)
Returns select query string based on query.
Declaration
public virtual string OnSelect(List<string> selects)
Parameters
| Type | Name | Description |
|---|---|---|
| List<string> | selects | List of field names to select. |
Returns
| Type | Description |
|---|---|
| string | string. |
OnTypeCheck(string, string, Type)
Declaration
public static object OnTypeCheck(string value, string field, Type ModelType)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | |
| string | field | |
| Type | ModelType |
Returns
| Type |
|---|
| object |
PerformDataOperation<T>(object)
Performs data operation. If its a remote data source then make a server request.
Declaration
public override 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. |
Overrides
PreventOdataFilter(Query)
Provides method to customize filter query which can be executed against default filter query.
Declaration
public virtual Query PreventOdataFilter(Query query = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Query | query |
Returns
| Type |
|---|
| Query |
ProcessBatchResponse<T>(object, DataManagerRequest)
Process the data operation batch response/result from the data source and make it understandable by user end.
Declaration
public override 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. |
Overrides
ProcessCrudResponse<T>(object, DataManagerRequest)
Process the CRUD operation response/result from the data source and make it understandable by user end.
Declaration
public override 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. |
Overrides
ProcessQuery(DataManagerRequest)
Read query from Query and make it understandable by data source.
Declaration
public override object ProcessQuery(DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManagerRequest | queries | Specifies the query. |
Returns
| Type | Description |
|---|---|
| object | object. |
Overrides
ProcessResponse<T>(object, DataManagerRequest)
Process the data operation response/result from the data source and make it understandable by user end.
Declaration
public override 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. |
Overrides
Remove(DataManager, string, object, string, Query)
Handles the remove operation.
Declaration
public override 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. |
Overrides
SetModelType(Type)
To get model type.
Declaration
public override void SetModelType(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type |
Overrides
Update(DataManager, string, object, string, Query, object, IDictionary<string, object>)
Handles the item update operation.
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 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. |