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.
This commit is contained in:
parent
7e66cd4dae
commit
bc45aadf27
@ -76,7 +76,14 @@ public class EnvelopeHistoryService : CRUDService<IEnvelopeHistoryRepository, En
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async Task<DataResult<long>> RecordAsync(int envelopeId, string userReference, EnvelopeStatus status, string? comment = null) =>
|
public async Task<DataResult<long>> 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(
|
.ThenAsync(
|
||||||
Success: id => Result.Success(id),
|
Success: id => Result.Success(id),
|
||||||
Fail: (mssg, ntc) => Result.Fail<long>().Message(mssg).Notice(ntc)
|
Fail: (mssg, ntc) => Result.Fail<long>().Message(mssg).Notice(ntc)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user