Refactor: Replace EmailAttachmentContext with DTO

Replaced `EmailAttachmentContext` with `EmailAttachmentDto` across the codebase to align with the updated DTO naming convention.

- Renamed `EmailAttachmentContext` to `EmailAttachmentDto`.
- Updated property types, method signatures, and return types to use `EmailAttachmentDto`.
- Modified XML documentation references to reflect the new class name.
- Updated `ReceivedEmailContext` to `ReceivedEmailDto` and adjusted related methods and properties.
- Refactored `FetchEmailsAsync` methods and handlers to use `ReceivedEmailDto`.
- Adjusted `BuildAttachmentsAsync` and attachment handling logic in `EmailController` and `LimilabsImapEmailService`.

This refactor ensures consistency and improves code clarity while maintaining functionality.
This commit is contained in:
2026-08-12 14:17:24 +02:00
parent 48796d9917
commit 176e6dd6c5
9 changed files with 23 additions and 23 deletions

View File

@@ -56,21 +56,21 @@ public class EmailController(IMediator mediator) : ControllerBase
return Accepted(new { Id = eventId });
}
private static async Task<IEnumerable<EmailAttachmentContext>> BuildAttachmentsAsync(
private static async Task<IEnumerable<EmailAttachmentDto>> BuildAttachmentsAsync(
IFormFileCollection? files,
CancellationToken cancellationToken)
{
if (files is null || files.Count == 0)
return [];
var result = new List<EmailAttachmentContext>(files.Count);
var result = new List<EmailAttachmentDto>(files.Count);
foreach (var file in files)
{
using var ms = new MemoryStream();
await file.CopyToAsync(ms, cancellationToken);
result.Add(new EmailAttachmentContext
result.Add(new EmailAttachmentDto
{
FileName = file.FileName,
Content = ms.ToArray(),