Interface IEmailTemplateRepository
Defines the contract for email template data access operations.
Namespace: OEMS.Core.Domain.RepoInterfaces
Assembly: OEMS.Core.dll
Syntax
public interface IEmailTemplateRepository
Methods
CreateAsync(EmailTemplate)
Creates a new email template in the repository.
Declaration
Task<Guid> CreateAsync(EmailTemplate template)
Parameters
Type | Name | Description |
---|---|---|
EmailTemplate | template | The email template to create |
Returns
Type | Description |
---|---|
Task<Guid> | The identifier of the created template |
DeleteAsync(Guid)
Deletes an email template from the repository.
Declaration
Task DeleteAsync(Guid id)
Parameters
Type | Name | Description |
---|---|---|
Guid | id | The identifier of the template to delete |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous operation |
ExistsAsync(Guid)
Checks whether an email template exists in the repository.
Declaration
Task<bool> ExistsAsync(Guid id)
Parameters
Type | Name | Description |
---|---|---|
Guid | id | The identifier of the template to check |
Returns
Type | Description |
---|---|
Task<bool> | True if the template exists, otherwise false |
GetAllAsync()
Retrieves all email templates from the repository.
Declaration
Task<IEnumerable<EmailTemplate>> GetAllAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<EmailTemplate>> | A collection of all email templates |
GetByIdAsync(Guid)
Retrieves an email template by its identifier.
Declaration
Task<EmailTemplate> GetByIdAsync(Guid id)
Parameters
Type | Name | Description |
---|---|---|
Guid | id | The unique identifier of the email template |
Returns
Type | Description |
---|---|
Task<EmailTemplate> | The email template, or null if not found |
GetByOrganizationIdAsync(Guid)
Retrieves all email templates belonging to a specific organization.
Declaration
Task<IEnumerable<EmailTemplate>> GetByOrganizationIdAsync(Guid organizationId)
Parameters
Type | Name | Description |
---|---|---|
Guid | organizationId | The identifier of the organization |
Returns
Type | Description |
---|---|
Task<IEnumerable<EmailTemplate>> | A collection of email templates for the organization |
UpdateAsync(EmailTemplate)
Updates an existing email template in the repository.
Declaration
Task UpdateAsync(EmailTemplate template)
Parameters
Type | Name | Description |
---|---|---|
EmailTemplate | template | The email template with updated information |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous operation |