Class AppRedirectStore
SQL Server implementation of the application redirect store, managing URL redirects with caching support.
Implements
Inherited Members
Namespace: DataWeb.Http.SqlServer
Assembly: DataWeb.Data.SqlServer.dll
Syntax
public class AppRedirectStore : IAppRedirectStore
Remarks
Provides methods to retrieve application redirects from the Sys_AppRedirects table, with support for:
- Filtered queries by IdMaster
- In-memory caching of the entire redirect collection
- Temporary redirects with optional start/end date filtering
Constructors
AppRedirectStore(ISqlHelper, ICacheService)
SQL Server implementation of the application redirect store, managing URL redirects with caching support.
Declaration
public AppRedirectStore(ISqlHelper sqlHelper, ICacheService cacheService)
Parameters
| Type | Name | Description |
|---|---|---|
| ISqlHelper | sqlHelper | |
| ICacheService | cacheService |
Remarks
Provides methods to retrieve application redirects from the Sys_AppRedirects table, with support for:
- Filtered queries by IdMaster
- In-memory caching of the entire redirect collection
- Temporary redirects with optional start/end date filtering
Properties
Name
Gets the name of the store implementation.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
GetAppRedirectAsync(AppRedirectFilter, CancellationToken)
Retrieves a single application redirect based on the provided filter criteria.
Declaration
public Task<AppRedirect> GetAppRedirectAsync(AppRedirectFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AppRedirectFilter | filter | Filter criteria including IdMaster and other attributes. Must not be null. |
| CancellationToken | cancellationToken | Cancellation token for the async operation. |
Returns
| Type | Description |
|---|---|
| Task<AppRedirect> | The first AppRedirect object matching the filter criteria, or null if none found. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when filter is null. |
GetAppRedirectsAsync(AppRedirectFilter, CancellationToken)
Retrieves a collection of application redirects based on the provided filter criteria.
Declaration
public Task<IEnumerable<AppRedirect>> GetAppRedirectsAsync(AppRedirectFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| AppRedirectFilter | filter | Filter criteria including IdMaster and count. Must not be null. |
| CancellationToken | cancellationToken | Cancellation token for the async operation. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<AppRedirect>> | An enumerable collection of AppRedirect objects matching the filter criteria. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when filter is null. |
GetAppRedirectsCachedAsync(CancellationToken)
Retrieves all application redirects from cache, loading from database on first access.
Declaration
public Task<IEnumerable<AppRedirect>> GetAppRedirectsCachedAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | Cancellation token for the async operation. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<AppRedirect>> | An enumerable collection of all AppRedirect objects, cached in memory. |