Refactor SQL query execution in AddEnvelopeReceiverAsync
Updated the SQL query execution in the EnvelopeReceiverExecutor class to use a formatted SQL string directly with parameters instead of a parameterized query method. This change simplifies the execution but may introduce SQL injection risks and affect performance.
This commit is contained in:
parent
38d05850e3
commit
5fc689ee4d
@ -23,8 +23,9 @@ public class EnvelopeReceiverExecutor: SQLExecutor, IEnvelopeReceiverExecutor
|
||||
{
|
||||
using var connection = new SqlConnection(Params.ConnectionString);
|
||||
var sql = Provider.GetRequiredService<EnvelopeReceiverAddReadSQL>();
|
||||
var formattedSql = string.Format(sql.Raw, envelope_uuid.ToSqlParam(), emailAddress.ToSqlParam(), salutation.ToSqlParam(), phone.ToSqlParam());
|
||||
await connection.OpenAsync(cancellation);
|
||||
var envelopeReceivers = await connection.QueryAsync<EnvelopeReceiver>(sql.Raw, EnvelopeReceiverAddReadSQL.CreateParameters(envelope_uuid, emailAddress, salutation, phone));
|
||||
var envelopeReceivers = await connection.QueryAsync<EnvelopeReceiver>(formattedSql);
|
||||
var er = envelopeReceivers.FirstOrDefault();
|
||||
|
||||
if (er is null)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user