Search Results for

    Show / Hide Table of Contents

    Class EmailTemplateRepository

    Repository implementation for managing email template entities and their database operations.

    Inheritance
    object
    EmailTemplateRepository
    Implements
    IEmailTemplateRepository
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: OEMS.Core.Infrastructure.Repositories
    Assembly: OEMS.Core.dll
    Syntax
    public class EmailTemplateRepository : IEmailTemplateRepository

    Constructors

    EmailTemplateRepository(IDbContextFactory<OEMSDBContext>)

    Initializes a new instance of the EmailTemplateRepository class.

    Declaration
    public EmailTemplateRepository(IDbContextFactory<OEMSDBContext> contextFactory)
    Parameters
    Type Name Description
    IDbContextFactory<OEMSDBContext> contextFactory

    The database context factory for data operations

    Methods

    CreateAsync(EmailTemplate)

    Creates a new email template in the repository.

    Declaration
    public 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
    public 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
    public 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 database.

    Declaration
    public 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
    public 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
    public 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
    public 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

    Implements

    IEmailTemplateRepository
    In this article
    Back to top Generated by DocFX