Class WebApiAdaptor
Handles request and response to and from Web API controller.
Inherited Members
Namespace: Syncfusion.Blazor.Data
Assembly: Syncfusion.Blazor.dll
Syntax
public class WebApiAdaptor : ODataAdaptor
Constructors
WebApiAdaptor(DataManager)
Initializes a new instance of the WebApiAdaptor class.
Declaration
public WebApiAdaptor(DataManager dataManager)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManager | dataManager |
Methods
BeforeSend(HttpRequestMessage)
Adds required headers before sending the HTTP request.
Declaration
public override void BeforeSend(HttpRequestMessage request)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpRequestMessage | request | HTTP request message to modify. |
Overrides
GetName()
Gets the adaptor name.
Declaration
public override string GetName()
Returns
| Type | Description |
|---|---|
| string | The adaptor name. |
Overrides
Insert(DataManager, object, string, Query, int)
Creates request options for inserting data using Web API.
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 used for configuration. |
| object | data | Data entity to insert. |
| string | tableName | Target table name.This parameter is optional. |
| Query | query | Query context and parameters.This parameter is optional. |
| int | position | Position for insertion.This parameter is optional. |
Returns
| Type | Description |
|---|---|
| object | A RequestOptions object configured for insert. |
Overrides
IsRemote()
Indicates whether the adaptor performs remote operations.
Declaration
public override bool IsRemote()
Returns
| Type | Description |
|---|---|
| bool | Always returns true. |
Overrides
ProcessCrudResponse<T>(object, DataManagerRequest)
Processes the CRUD response and returns the deserialized result.
Declaration
public override Task<object> ProcessCrudResponse<T>(object data, DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| object | data | Raw HTTP response object to process. |
| DataManagerRequest | queries | DataManager request context. |
Returns
| Type | Description |
|---|---|
| Task<object> | Deserialized entity of type T or an empty object. |
Type Parameters
| Name |
|---|
| T |
Overrides
ProcessQuery(DataManagerRequest)
Processes the query and appends aggregate information if available.
Declaration
public override object ProcessQuery(DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| DataManagerRequest | queries | DataManager request containing query details. |
Returns
| Type | Description |
|---|---|
| object | A RequestOptions object prepared for the operation. |
Overrides
ProcessResponse<T>(object, DataManagerRequest)
Processes the response from the Web API and returns the result or aggregated data.
Declaration
public override Task<object> ProcessResponse<T>(object data, DataManagerRequest queries)
Parameters
| Type | Name | Description |
|---|---|---|
| object | data | Raw HTTP response object to process. |
| DataManagerRequest | queries | DataManager request specifying counts, grouping, and aggregates. |
Returns
| Type | Description |
|---|---|
| Task<object> | An object containing the result list or a DataResult with counts and aggregates. |
Type Parameters
| Name |
|---|
| T |
Overrides
Remove(DataManager, string, object, string, Query)
Creates request options for removing data using Web API.
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 used for configuration. |
| string | keyField | Key field name identifying the entity. |
| object | value | Key value of the entity 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 | A RequestOptions object configured for remove. |
Overrides
Update(DataManager, string, object, string, Query, object, IDictionary<string, object>)
Creates request options for updating data using Web API.
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 used for configuration. |
| string | keyField | Key field name identifying the entity. |
| object | data | Data entity 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 entity before updates.This parameter is optional. |
| IDictionary<string, object> | updateProperties | Properties and values to update.This parameter is optional. |
Returns
| Type | Description |
|---|---|
| object | A RequestOptions object configured for update. |