Class AreaStore
Manages area data in SQL Server with caching support.
Implements
Inherited Members
Namespace: DataWeb.Structure.SqlServer
Assembly: DataWeb.Data.SqlServer.dll
Syntax
public class AreaStore : IAreaStore
Constructors
AreaStore(ISqlHelper, ICacheService)
Manages area data in SQL Server with caching support.
Declaration
public AreaStore(ISqlHelper sqlHelper, ICacheService cacheService)
Parameters
| Type | Name | Description |
|---|---|---|
| ISqlHelper | sqlHelper | |
| ICacheService | cacheService |
Properties
Name
The name of the area store.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
GetAreaAsync(AreaFilter, CancellationToken)
Retrieves a single area matching the specified filter criteria.
Declaration
public Task<AreaData> GetAreaAsync(AreaFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AreaFilter | filter | The filter criteria for the area. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<AreaData> | The first area matching the filter, or null if no match found. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when filter is null. |
GetAreaCachedAsync(string, CancellationToken)
Retrieves a cached area by name.
Declaration
public Task<AreaData> GetAreaCachedAsync(string name, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the area to retrieve. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<AreaData> | The cached area, or null if not found. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when name is null or empty. |
GetAreasAsync(AreaFilter, CancellationToken)
Retrieves areas matching the specified filter criteria.
Declaration
public Task<IEnumerable<AreaData>> GetAreasAsync(AreaFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AreaFilter | filter | The filter criteria for areas. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<AreaData>> | A collection of areas matching the filter. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when filter is null. |
GetAreasCachedAsync(PublishMode, CancellationToken)
Retrieves all areas with caching, optionally filtered by publish mode.
Declaration
public Task<IEnumerable<AreaData>> GetAreasCachedAsync(PublishMode publishMode = PublishMode.Preview, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| PublishMode | publishMode | The publish mode to filter by. Defaults to Preview. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<AreaData>> | A cached collection of areas. |