ReadByName in EmailTemplate Repositroy und Dienst hinzugefügt.

This commit is contained in:
Developer 02
2024-05-17 13:59:40 +02:00
parent 2e66129485
commit bc6972bcfb
6 changed files with 56 additions and 13 deletions

View File

@@ -2,6 +2,8 @@
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
{
@@ -10,5 +12,7 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
public EmailTemplateRepository(EGDbContext dbContext) : base(dbContext)
{
}
public async Task<EmailTemplate?> ReadByNameAsync(EmailTemplateType type) => await _dbSet.Where(t => t.Name == type.ToString()).FirstOrDefaultAsync();
}
}