Class ElementStore
Manages element data in SQL Server with caching support.
Implements
Inherited Members
Namespace: DataWeb.Structure.SqlServer
Assembly: DataWeb.Data.SqlServer.dll
Syntax
public class ElementStore : IElementStore
Constructors
ElementStore(ISqlHelper, ICacheService)
Manages element data in SQL Server with caching support.
Declaration
public ElementStore(ISqlHelper sqlHelper, ICacheService cacheService)
Parameters
| Type | Name | Description |
|---|---|---|
| ISqlHelper | sqlHelper | |
| ICacheService | cacheService |
Properties
Name
The name of the element store.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
GetElementAsync(ElementFilter, CancellationToken)
Retrieves a single element matching the specified filter criteria.
Declaration
public Task<ElementData> GetElementAsync(ElementFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ElementFilter | filter | The filter criteria for the element. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<ElementData> | The first element matching the filter, or null if no match found. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when filter is null. |
GetElementCachedAsync(string, CancellationToken)
Retrieves a cached element by name.
Declaration
public Task<ElementData> GetElementCachedAsync(string name, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the element to retrieve. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<ElementData> | The cached element, or null if not found. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when name is null or empty. |
GetElementsAsync(ElementFilter, CancellationToken)
Retrieves elements matching the specified filter criteria.
Declaration
public Task<IEnumerable<ElementData>> GetElementsAsync(ElementFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ElementFilter | filter | The filter criteria for elements. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<ElementData>> | A collection of elements matching the filter. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when filter is null. |