Merge remote-tracking branch 'origin/v11/dev' into v12/dev
This commit is contained in:
@@ -37,5 +37,5 @@ internal class AccessDto
|
||||
|
||||
[ResultColumn]
|
||||
[Reference(ReferenceType.Many, ReferenceMemberName = "AccessId")]
|
||||
public List<AccessRuleDto> Rules { get; set; } = null!;
|
||||
public List<AccessRuleDto> Rules { get; set; } = new();
|
||||
}
|
||||
|
||||
@@ -1385,10 +1385,15 @@ AND umbracoNode.id <> @id",
|
||||
}
|
||||
|
||||
// Now bulk update the umbracoDocument table
|
||||
foreach (IGrouping<bool, KeyValuePair<int, bool>> editValue in editedDocument.GroupBy(x => x.Value))
|
||||
// we need to do this in batches as the WhereIn Npoco method translates to all the nodeIds being passed in as parameters when using the SqlClient provider
|
||||
// this results in to many parameters (>2100) being passed to the client when there are a lot of documents being normalized
|
||||
foreach (IGrouping<bool, KeyValuePair<int, bool>> groupByValue in editedDocument.GroupBy(x => x.Value))
|
||||
{
|
||||
Database.Execute(Sql().Update<DocumentDto>(u => u.Set(x => x.Edited, editValue.Key))
|
||||
.WhereIn<DocumentDto>(x => x.NodeId, editValue.Select(x => x.Key)));
|
||||
foreach (IEnumerable<KeyValuePair<int, bool>> batch in groupByValue.InGroupsOf(2000))
|
||||
{
|
||||
Database.Execute(Sql().Update<DocumentDto>(u => u.Set(x => x.Edited, groupByValue.Key))
|
||||
.WhereIn<DocumentDto>(x => x.NodeId, batch.Select(x => x.Key)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user