Use block rather than local using statement.

pull/1838/head
Andrew Mahone 5 years ago
parent 4f3b883155
commit 74fb63a898

@ -6184,7 +6184,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
cmdText += " order by AttachmentIndex ASC";
var list = new List<MediaAttachment>();
using var connection = GetConnection(true);
using (var connection = GetConnection(true))
using (var statement = PrepareStatement(connection, cmdText))
{
statement.TryBind("@ItemId", query.ItemId.ToByteArray());
@ -6218,7 +6218,8 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
cancellationToken.ThrowIfCancellationRequested();
using var connection = GetConnection();
using (var connection = GetConnection())
{
connection.RunInTransaction(db =>
{
var itemIdBlob = id.ToByteArray();
@ -6229,6 +6230,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
}, TransactionMode);
}
}
private void InsertMediaAttachments(byte[] idBlob, List<MediaAttachment> attachments, IDatabaseConnection db)
{

Loading…
Cancel
Save