diff --git a/Orm/Xtensive.Orm/Orm/Model/TypeInfoCollection.cs b/Orm/Xtensive.Orm/Orm/Model/TypeInfoCollection.cs index baf10c7ac..3d8665e5c 100644 --- a/Orm/Xtensive.Orm/Orm/Model/TypeInfoCollection.cs +++ b/Orm/Xtensive.Orm/Orm/Model/TypeInfoCollection.cs @@ -4,9 +4,7 @@ // Created by: Dmitri Maximov // Created: 2007.08.27 -using System; -using System.Collections.Generic; -using System.Linq; +using System.Collections.Frozen; using Xtensive.Collections; using Xtensive.Core; using Xtensive.Reflection; @@ -21,7 +19,7 @@ public sealed class TypeInfoCollection : NodeCollection, IFilterable { - private readonly Dictionary typeTable = new(); + private IDictionary typeTable = new Dictionary(); private readonly Dictionary fullNameTable = new(); private TypeIdRegistry typeIdRegistry; @@ -253,6 +251,11 @@ protected override string GetExceptionMessage(string key) + " You might have forgotten to register type {0} as an element of domain model.", key); } + public override void Lock(bool recursive) + { + base.Lock(recursive); + typeTable = typeTable.ToFrozenDictionary(); + } // Constructors