Class BasicItem
Represents an item in the structure.
Inherited Members
Namespace: DataWeb.Structure
Assembly: DataWeb.Core.dll
Syntax
public sealed class BasicItem
Remarks
Initializes a new instance of the BasicItem class.
Constructors
BasicItem(IBasicItemStore)
Represents an item in the structure.
Declaration
public BasicItem(IBasicItemStore basicItemStore)
Parameters
Type | Name | Description |
---|---|---|
IBasicItemStore | basicItemStore |
Remarks
Initializes a new instance of the BasicItem class.
Properties
Data
Gets or sets the section data for the section part.
Declaration
public Dictionary<string, object> Data { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<string, object> |
Id
Gets or sets the unique identifier.
Declaration
public string Id { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
CheckDataChanges(Dictionary<string, object>)
Checks a provided data against original data in order to get modified fields.
Declaration
public List<string> CheckDataChanges(Dictionary<string, object> providedData)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<string, object> | providedData | The provided section data. |
Returns
Type | Description |
---|---|
List<string> |
DeleteAsync(CancellationToken)
Deletes this item by changing the status to Deleted.
Declaration
public Task DeleteAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
DeleteFromStorageAsync(CancellationToken)
Deletes this item from storage.
Declaration
public Task DeleteFromStorageAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
Init(string, string, Dictionary<string, object>)
Initializes the item with the specified Id.
Declaration
public void Init(string id, string tableName, Dictionary<string, object> providedData)
Parameters
Type | Name | Description |
---|---|---|
string | id | The Id of the item. |
string | tableName | The table used to retrieve data. |
Dictionary<string, object> | providedData |
InitAsync(string, string, CancellationToken)
Initializes the item with the specified Id.
Declaration
public Task InitAsync(string id, string tableName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | id | The Id of the item. |
string | tableName | The table used to retrieve data. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
SaveAsync(CancellationToken)
Saves the data of the item to the database asynchronously.
Declaration
public Task<List<string>> SaveAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<List<string>> | A list of modified fields in the section data. |
UpdateStatusAsync(string, CancellationToken)
Updates the status of this item.
Declaration
public Task UpdateStatusAsync(string status, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | status | The new status for the item. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |