Class ContextItemStore
Manages context item data retrieval and filtering operations in SQL Server. Supports complex queries with multiple sections, permissions, and search capabilities.
Implements
Inherited Members
Namespace: DataWeb.Structure.SqlServer
Assembly: DataWeb.Data.SqlServer.dll
Syntax
public class ContextItemStore : IContextItemStore
Constructors
ContextItemStore(ISqlHelper)
Manages context item data retrieval and filtering operations in SQL Server. Supports complex queries with multiple sections, permissions, and search capabilities.
Declaration
public ContextItemStore(ISqlHelper sqlHelper)
Parameters
| Type | Name | Description |
|---|---|---|
| ISqlHelper | sqlHelper |
Properties
Name
The name of the store.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
GetContextItemAsync(ContextItemFilter, CancellationToken)
Retrieves a single context item matching the specified filter criteria.
Declaration
public Task<ContextItemData> GetContextItemAsync(ContextItemFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ContextItemFilter | filter | The filter criteria including navigation, permissions, and sections. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<ContextItemData> | The first ContextItemData matching the filter, or null if no match found. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when filter is null. |
GetContextItemCountAsync(ContextItemFilter, CancellationToken)
Retrieves the total count of context items matching the specified filter criteria.
Declaration
public Task<long> GetContextItemCountAsync(ContextItemFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ContextItemFilter | filter | The filter criteria including navigation, permissions, and sections. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<long> | The total count of context items matching the filter. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when filter is null. |
GetContextItemsAsync(ContextItemFilter, CancellationToken)
Retrieves a collection of context items matching the specified filter criteria.
Declaration
public Task<IEnumerable<ContextItemData>> GetContextItemsAsync(ContextItemFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ContextItemFilter | filter | The filter criteria including navigation, permissions, and sections. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<ContextItemData>> | A collection of ContextItemData objects matching the filter. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when filter, filter.Navigation, or filter.PermissionSet is null. |