Refactor SQL queries and data mappings
- Updated SQL query in `EnvelopeReceiverAddReadSQL.cs` to select specific columns (`ENVELOPE_ID` and `RECEIVER_ID`) for improved performance and clarity. - Changed mapping of `SentRecipients` in `EnvelopeReceiverController.cs` to expect a single `ReceiverReadDto` instead of a collection, reflecting a change in data handling. - Modified `QueryAsync` in `EnvelopeReceiverExecutor.cs` to remove the generic type parameter, allowing for more flexible data handling.
This commit is contained in:
parent
6bdf0d5220
commit
1875acb7b5
@ -22,8 +22,8 @@ public class EnvelopeReceiverAddReadSQL : ISQL<Envelope>
|
|||||||
{3},
|
{3},
|
||||||
@OUT_RECEIVER_ID OUTPUT
|
@OUT_RECEIVER_ID OUTPUT
|
||||||
|
|
||||||
SELECT TOP(1) *
|
SELECT TOP(1) [ENVELOPE_ID] As EnvelopeId, [RECEIVER_ID] As ReceiverId
|
||||||
FROM TBSIG_ENVELOPE_RECEIVER
|
FROM [dbo].[TBSIG_ENVELOPE_RECEIVER]
|
||||||
WHERE [GUID] = @OUT_RECEIVER_ID;
|
WHERE [GUID] = @OUT_RECEIVER_ID;
|
||||||
";
|
";
|
||||||
|
|
||||||
|
|||||||
@ -217,7 +217,7 @@ public class EnvelopeReceiverController : ControllerBase
|
|||||||
|
|
||||||
var res = _mapper.Map<CreateEnvelopeReceiverResponse>(envelope);
|
var res = _mapper.Map<CreateEnvelopeReceiverResponse>(envelope);
|
||||||
res.UnsentRecipients = unsentRecipients;
|
res.UnsentRecipients = unsentRecipients;
|
||||||
res.SentRecipients = _mapper.Map<IEnumerable<ReceiverReadDto>>(sentRecipients);
|
res.SentRecipients = _mapper.Map<List<ReceiverReadDto>>(sentRecipients);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Add document
|
#region Add document
|
||||||
|
|||||||
@ -24,7 +24,7 @@ public class EnvelopeReceiverExecutor: SQLExecutor, IEnvelopeReceiverExecutor
|
|||||||
var sql = Provider.GetRequiredService<EnvelopeReceiverAddReadSQL>();
|
var sql = Provider.GetRequiredService<EnvelopeReceiverAddReadSQL>();
|
||||||
var formattedSql = string.Format(sql.Raw, envelope_uuid.ToSqlParam(), emailAddress.ToSqlParam(), salutation.ToSqlParam(), phone.ToSqlParam());
|
var formattedSql = string.Format(sql.Raw, envelope_uuid.ToSqlParam(), emailAddress.ToSqlParam(), salutation.ToSqlParam(), phone.ToSqlParam());
|
||||||
await connection.OpenAsync(cancellation);
|
await connection.OpenAsync(cancellation);
|
||||||
var envelopeReceivers = await connection.QueryAsync<EnvelopeReceiver>(formattedSql);
|
var envelopeReceivers = await connection.QueryAsync(formattedSql);
|
||||||
var er = envelopeReceivers.FirstOrDefault();
|
var er = envelopeReceivers.FirstOrDefault();
|
||||||
|
|
||||||
if (er is null)
|
if (er is null)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user