refactor(infrastructure): rename CreateAsync bulk overload to CreateRangeAsync and use AsNoTracking in ReceivedEmailRepository

This commit is contained in:
2026-08-13 16:48:34 +02:00
parent 6abe0e18f6
commit 578ecc7ba1
2 changed files with 2 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ public class ReceivedEmailRepository(MessagingServiceDbContext Context, IMapper
{
public async Task<IEnumerable<ReceivedEmail>> FindAsync(MailSearchFilter mailSearchFilter, EmailAccount? accountQuery = null, CancellationToken cancellationToken = default)
{
IQueryable<ReceivedEmail> query = DbSet;
var query = DbSet.AsNoTracking();
// ── Account filter ─────────────────────────────────────────────────────
if (accountQuery is not null)

View File

@@ -25,7 +25,7 @@ public class Repository<TEntity>(MessagingServiceDbContext Context, IMapper Mapp
return entity;
}
public async Task<IEnumerable<TEntity>> CreateAsync<TDto>(IEnumerable<TDto> dtos, CancellationToken cancellationToken = default)
public async Task<IEnumerable<TEntity>> CreateRangeAsync<TDto>(IEnumerable<TDto> dtos, CancellationToken cancellationToken = default)
{
var entities = Mapper.Map<IEnumerable<TEntity>>(dtos);
await DbSet.AddRangeAsync(entities, cancellationToken);