Skip to content

Commit

Permalink
Make ShapeTables created by PerTenantShapeTableManager frozen
Browse files Browse the repository at this point in the history
to match DefaultShapeTableManager where this change was made in PR OrchardCMS/OrchardCore#15651.
  • Loading branch information
sarahelsaig committed Jul 28, 2024
1 parent 923d3f0 commit b7e6247
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using OrchardCore.Settings;
using System;
using System.Collections.Concurrent;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
Expand Down Expand Up @@ -124,8 +125,8 @@ public async Task<ShapeTable> GetShapeTableAsync(string themeId)
.ToList();

shapeTable = new ShapeTable(
descriptors: descriptors.ToDictionary(sd => sd.ShapeType, x => (ShapeDescriptor)x, StringComparer.OrdinalIgnoreCase),
bindings: descriptors.SelectMany(sd => sd.Bindings).ToDictionary(kv => kv.Key, kv => kv.Value, StringComparer.OrdinalIgnoreCase)
descriptors: descriptors.ToFrozenDictionary(sd => sd.ShapeType, x => (ShapeDescriptor)x, StringComparer.OrdinalIgnoreCase),
bindings: descriptors.SelectMany(sd => sd.Bindings).ToFrozenDictionary(kv => kv.Key, kv => kv.Value, StringComparer.OrdinalIgnoreCase)
);

if (_logger.IsEnabled(LogLevel.Information))
Expand Down

0 comments on commit b7e6247

Please sign in to comment.