Class NewsletterRowService
Provides implementation for a service that manages newsletter rows.
Implements
Inherited Members
Namespace: DataWeb.Newsletter
Assembly: DataWeb.Core.dll
Syntax
public class NewsletterRowService : INewsletterRowService
Remarks
Initializes a new instance of the NewsletterRowService class with the specified dependencies.
Constructors
NewsletterRowService(IItemService, INewsletterModelService, INewsletterMailingListService, INewsletterRowStore, INewsletterEventStore, TimeProvider)
Provides implementation for a service that manages newsletter rows.
Declaration
public NewsletterRowService(IItemService itemService, INewsletterModelService modelService, INewsletterMailingListService mailingListService, INewsletterRowStore rowStore, INewsletterEventStore eventStore, TimeProvider timeProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| IItemService | itemService | The item service used for creating and saving newsletter rows. |
| INewsletterModelService | modelService | The newsletter model service used for rendering newsletter body content. |
| INewsletterMailingListService | mailingListService | The newsletter mailing list service used for retrieving subscriber counts. |
| INewsletterRowStore | rowStore | The newsletter row store used for persisting newsletter rows. |
| INewsletterEventStore | eventStore | The newsletter event store used for retrieving event counts. |
| TimeProvider | timeProvider |
Remarks
Initializes a new instance of the NewsletterRowService class with the specified dependencies.
Methods
GetReportAsync(NewsletterRow, CancellationToken)
Gets a report for the specified newsletter row.
Declaration
public Task<NewsletterRowReport> GetReportAsync(NewsletterRow newsletterRow, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| NewsletterRow | newsletterRow | The NewsletterRow for which to generate the report. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<NewsletterRowReport> | A task representing the asynchronous operation that returns the newsletter row report. |
GetRowAsync(NewsletterRowFilter, CancellationToken)
Gets a single newsletter row based on the specified filter.
Declaration
public Task<NewsletterRow> GetRowAsync(NewsletterRowFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| NewsletterRowFilter | filter | The NewsletterRowFilter to use for retrieving the row. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<NewsletterRow> | A task representing the asynchronous operation that returns the retrieved newsletter row. |
GetRowsAsync(NewsletterRowFilter, CancellationToken)
Gets a collection of newsletter rows based on the specified filter.
Declaration
public Task<IEnumerable<NewsletterRow>> GetRowsAsync(NewsletterRowFilter filter, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| NewsletterRowFilter | filter | The NewsletterRowFilter to use for retrieving the rows. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<NewsletterRow>> | A task representing the asynchronous operation that returns the retrieved collection of newsletter rows. |
SetRowFromModelAsync(NewsletterModel, CancellationToken)
Sets a newsletter row based on the specified newsletter model.
Declaration
public Task<string> SetRowFromModelAsync(NewsletterModel newsletterModel, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| NewsletterModel | newsletterModel | The NewsletterModel to use for generating the newsletter row. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<string> | A task representing the asynchronous operation that returns the Id of the newly created newsletter row. |
SetSendDateTimeAsync(string, CancellationToken)
Sets the send date and time of a newsletter row based on the specified row Id.
Declaration
public Task SetSendDateTimeAsync(string rowIdMaster, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | rowIdMaster | The Id of the newsletter row to update. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |
SetStatusAsync(string, NewsletterRowStatus, CancellationToken)
Sets the status of a newsletter row based on the specified row Id and status.
Declaration
public Task SetStatusAsync(string rowIdMaster, NewsletterRowStatus status, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | rowIdMaster | The Id of the newsletter row to update. |
| NewsletterRowStatus | status | The new NewsletterRowStatus of the newsletter row. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |