Interface IBasicItemStore
Interface for a data store that provides CRUD operations for item data.
Namespace: DataWeb.Structure
Assembly: DataWeb.Core.dll
Syntax
public interface IBasicItemStore
Methods
DeleteAsync(string, string, CancellationToken)
Delete an item with the given itemId
.
Declaration
Task DeleteAsync(string itemId, string tableName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | itemId | The Id of the item. |
string | tableName | The table used to set data. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
GetItemAsync(BasicItemFilter, string, CancellationToken)
Retrieves a basic item based on the provided filter.
Declaration
Task<BasicItem> GetItemAsync(BasicItemFilter filter, string tableName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
BasicItemFilter | filter | The BasicItemFilter used to retrieve the item. |
string | tableName | The table used to retrieve data. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<BasicItem> | A basic items. |
GetItemCountAsync(BasicItemFilter, string, CancellationToken)
Retrieves the number of basic items based on the provided filter.
Declaration
Task<long> GetItemCountAsync(BasicItemFilter filter, string tableName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
BasicItemFilter | filter | The BasicItemFilter used to retrieve the count of basic items. |
string | tableName | The table used to retrieve data. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<long> | The number of basic items that match the provided filter. |
GetItemDataAsync(string, string, CancellationToken)
Gets the master part of an item asynchronously.
Declaration
Task<Dictionary<string, object>> GetItemDataAsync(string itemId, string tableName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | itemId | The Id of the item. |
string | tableName | The table used to retrieve data. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Dictionary<string, object>> | The master part of the item. |
GetItemsAsync(BasicItemFilter, string, CancellationToken)
Retrieves a collection of basic items based on the provided filter.
Declaration
Task<IEnumerable<BasicItem>> GetItemsAsync(BasicItemFilter filter, string tableName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
BasicItemFilter | filter | The BasicItemFilter used to retrieve the items. |
string | tableName | The table used to retrieve data. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<BasicItem>> | A collection of basic items. |
SetItemDataAsync(string, Dictionary<string, object>, List<string>, string, CancellationToken)
Sets the master part of an item asynchronously.
Declaration
Task<string> SetItemDataAsync(string itemId, Dictionary<string, object> data, List<string> modifiedFields, string tableName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | itemId | The Id of the item. |
Dictionary<string, object> | data | The data to set. |
List<string> | modifiedFields | The modified fields to set. |
string | tableName | The table used to set data. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<string> | The Id of the item. |
SetStatusAsync(string, string, string, CancellationToken)
Sets the status of an item with the given itemId
.
Declaration
Task SetStatusAsync(string itemId, string status, string tableName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | itemId | The Id of the item. |
string | status | The new status of the item. |
string | tableName | The table used to set data. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |