18 lines
727 B
C#

using DigitalData.Core.Infrastructure;
using DigitalData.UserManager.Infrastructure.Repositories;
using EnvelopeGenerator.Domain.Entities;
using EnvelopeGenerator.Infrastructure.Contracts;
using Microsoft.EntityFrameworkCore;
using static EnvelopeGenerator.Common.Constants;
namespace EnvelopeGenerator.Infrastructure.Repositories
{
public class EmailTemplateRepository : CRUDRepository<EmailTemplate, int, EGDbContext>, IEmailTemplateRepository
{
public EmailTemplateRepository(EGDbContext dbContext) : base(dbContext)
{
}
public async Task<EmailTemplate?> ReadByNameAsync(EmailTemplateType type) => await _dbSet.Where(t => t.Name == type.ToString()).FirstOrDefaultAsync();
}
}