Skip to content

Commit 6c6e9be

Browse files
committed
Improve ancestor property
1 parent 7204a0a commit 6c6e9be

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Orm/Xtensive.Orm/Orm/Model/TypeInfo.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ public sealed class TypeInfo : SchemaMappedNode
6767
private List<AssociationInfo> overridenAssociations;
6868
private FieldInfo typeIdField;
6969

70-
public TypeInfo Ancestor { get; internal set; }
70+
private TypeInfo ancestor;
71+
public TypeInfo Ancestor {
72+
get => ancestor;
73+
internal set => ancestor = ancestor == null ? value : throw Exceptions.AlreadyInitialized(nameof(Ancestor));
74+
}
7175

7276
/// <summary>
7377
/// Gets the ancestors recursively. Inheritor-to-root order.

0 commit comments

Comments
 (0)