Refactor DocumentCreateReadSQL to remove envelope_uuid
Updated CreateParmas method to accept only base64 string. Converted base64 to byte array and added it as ByteData. Adjusted SQL command and DocumentExecutor to reflect these changes.
This commit is contained in:
@@ -18,9 +18,10 @@ public class DocumentExecutor : SQLExecutor, IDocumentExecutor
|
||||
{
|
||||
using var connection = new SqlConnection(Params.ConnectionString);
|
||||
var sql = Provider.GetRequiredService<DocumentCreateReadSQL>();
|
||||
var formattedSql = string.Format(sql.Raw, base64.ToSqlParam(), envelope_uuid.ToSqlParam());
|
||||
var formattedSql = string.Format(sql.Raw, envelope_uuid.ToSqlParam());
|
||||
var param = DocumentCreateReadSQL.CreateParmas(base64);
|
||||
await connection.OpenAsync(cancellation);
|
||||
var documents = await connection.QueryAsync<EnvelopeDocument>(formattedSql);
|
||||
var documents = await connection.QueryAsync<EnvelopeDocument>(formattedSql, param);
|
||||
return documents.FirstOrDefault()
|
||||
?? throw new InvalidOperationException($"Document creation failed. Parameters:" +
|
||||
$"base64={base64}, envelope_uuid='{envelope_uuid}'.");
|
||||
|
||||
Reference in New Issue
Block a user