Refactor Attachments property and syntax
Changed the `Attachments` property type in `EnvelopeNotificationBase.cs` from `List` to `IReadOnlyList` to enhance immutability and thread safety. Updated the `FinalizeEnvelopeCommandHandler` in `FinalizeEnvelopeCommand.cs` to use a single-line syntax for `Attachments` initialization, improving code readability.
This commit is contained in:
@@ -15,5 +15,5 @@ public abstract record EnvelopeNotificationBase
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<(string FileName, byte[] Content)>? Attachments { get; init; }
|
||||
public IReadOnlyList<(string FileName, byte[] Content)>? Attachments { get; init; }
|
||||
}
|
||||
|
||||
@@ -98,9 +98,7 @@ public class FinalizeEnvelopeCommandHandler(IRepository<Envelope> Repo, ISender
|
||||
{
|
||||
DocumentTitle = envelope.Title,
|
||||
NameReceiver = er.Name,
|
||||
Attachments = [
|
||||
($"unterzeichnetes-dokument.pdf", doc)
|
||||
]
|
||||
Attachments = [($"unterzeichnetes-dokument.pdf", doc)]
|
||||
}, cancel);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user