Class NewsletterRowStore
SQL Server newsletter row store implementation. Manages persistence and retrieval of newsletter rows from the database.
Implements
Inherited Members
Namespace: DataWeb.Newsletter.SqlServer
Assembly: DataWeb.Data.SqlServer.dll
Syntax
public class NewsletterRowStore : INewsletterRowStore
Constructors
NewsletterRowStore(ISqlHelper, TimeProvider)
SQL Server newsletter row store implementation. Manages persistence and retrieval of newsletter rows from the database.
Declaration
public NewsletterRowStore(ISqlHelper sqlHelper, TimeProvider timeProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| ISqlHelper | sqlHelper | |
| TimeProvider | timeProvider |
Properties
Name
The name of the newsletter row store.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
GetPendingCreditsAsync(CancellationToken)
Retrieves the total count of pending newsletter rows (Waiting or Working status).
Declaration
public Task<long> GetPendingCreditsAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | Token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task<long> | Number of pending newsletter rows. |
GetRowAsync(NewsletterRowFilter, CancellationToken)
Retrieves a single newsletter row based on the specified filter criteria.
Declaration
public Task<NewsletterRow> GetRowAsync(NewsletterRowFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| NewsletterRowFilter | filter | Search criteria. Cannot be null. |
| CancellationToken | cancellationToken | Token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task<NewsletterRow> | The newsletter row found, or null if not found. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If filter is null. |
GetRowsAsync(NewsletterRowFilter, CancellationToken)
Retrieves a collection of newsletter rows based on the specified filters.
Declaration
public Task<IEnumerable<NewsletterRow>> GetRowsAsync(NewsletterRowFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| NewsletterRowFilter | filter | Search criteria. Cannot be null. |
| CancellationToken | cancellationToken | Token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<NewsletterRow>> | Collection of newsletter rows matching the filter criteria. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If filter is null. |
SetSendDateTimeAsync(string, CancellationToken)
Sets the send date and time of a newsletter row to the current local time.
Declaration
public Task SetSendDateTimeAsync(string rowIdMaster, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | rowIdMaster | Identifier of the newsletter row. Cannot be null or empty. |
| CancellationToken | cancellationToken | Token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If rowIdMaster is null or empty. |
SetStatusAsync(string, NewsletterRowStatus, CancellationToken)
Updates the status of a newsletter row.
Declaration
public Task SetStatusAsync(string rowIdMaster, NewsletterRowStatus status, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | rowIdMaster | Identifier of the newsletter row. Cannot be null or empty. |
| NewsletterRowStatus | status | New status to set. |
| CancellationToken | cancellationToken | Token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If rowIdMaster is null or empty. |