From bc45aadf27d1bff1c0da28fdbfb7c839afedd98a Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Tue, 13 May 2025 11:21:01 +0200 Subject: [PATCH] Refactor RecordAsync object initialization Updated the `RecordAsync` method in the `EnvelopeHistoryService` class to use an explicit object initializer with braces for creating a new object in the `CreateAsync` method. This change improves code clarity while maintaining the same functionality. --- .../Services/EnvelopeHistoryService.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/EnvelopeGenerator.Application/Services/EnvelopeHistoryService.cs b/EnvelopeGenerator.Application/Services/EnvelopeHistoryService.cs index 9d0bc453..4c07280e 100644 --- a/EnvelopeGenerator.Application/Services/EnvelopeHistoryService.cs +++ b/EnvelopeGenerator.Application/Services/EnvelopeHistoryService.cs @@ -76,7 +76,14 @@ public class EnvelopeHistoryService : CRUDService> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null) => - await CreateAsync(new (EnvelopeId: envelopeId, UserReference: userReference, Status: (int)status, ActionDate: DateTime.Now, Comment: comment)) + await CreateAsync(new () + { + EnvelopeId = envelopeId, + UserReference = userReference, + Status = (int) status, + ActionDate = DateTime.Now, + Comment = comment + }) .ThenAsync( Success: id => Result.Success(id), Fail: (mssg, ntc) => Result.Fail().Message(mssg).Notice(ntc)