Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Orm/Xtensive.Orm/Orm/Model/TypeInfoCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -21,7 +19,7 @@ public sealed class TypeInfoCollection
: NodeCollection<TypeInfo>,
IFilterable<TypeAttributes, TypeInfo>
{
private readonly Dictionary<Type, TypeInfo> typeTable = new();
private IDictionary<Type, TypeInfo> typeTable = new Dictionary<Type, TypeInfo>();
private readonly Dictionary<string, TypeInfo> fullNameTable = new();

private TypeIdRegistry typeIdRegistry;
Expand Down Expand Up @@ -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

Expand Down