Skip to content

Commit 760ad7d

Browse files
committed
Expose WithoutAutoRegistrationOfRelations in DBOptions.
1 parent eea3409 commit 760ad7d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

BTDB/ODBLayer/DBOptions.cs

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class DBOptions
1010
public DBOptions()
1111
{
1212
AutoRegisterType = true;
13+
AutoRegisterRelations = true;
1314
}
1415

1516
public DBOptions WithoutAutoRegistration()
@@ -18,6 +19,12 @@ public DBOptions WithoutAutoRegistration()
1819
return this;
1920
}
2021

22+
public DBOptions WithoutAutoRegistrationOfRelations()
23+
{
24+
AutoRegisterRelations = false;
25+
return this;
26+
}
27+
2128
public DBOptions WithCustomType2NameRegistry(IType2NameRegistry registry)
2229
{
2330
CustomType2NameRegistry = registry;
@@ -54,6 +61,7 @@ public DBOptions WithFieldHandlerLogger(IFieldHandlerLogger fieldHandlerLogger)
5461
return this;
5562
}
5663

64+
public bool AutoRegisterRelations { get; private set; }
5765
public bool AutoRegisterType { get; private set; }
5866
public IType2NameRegistry? CustomType2NameRegistry { get; private set; }
5967
public bool SelfHealing { get; private set; }

BTDB/ODBLayer/ObjectDB.cs

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public static void ResetAllMetadataCaches()
8181
internal IType2NameRegistry Type2NameRegistry => _type2Name;
8282

8383
public bool AutoRegisterTypes { get; set; }
84+
public bool AutoRegisterRelations { get; set; }
8485

8586
public DBOptions ActualOptions { get; private set; }
8687

@@ -101,6 +102,7 @@ public void Open(IKeyValueDB keyValueDB, bool dispose, DBOptions options)
101102
_type2Name = options.CustomType2NameRegistry ?? new Type2NameRegistry();
102103
_polymorphicTypesRegistry = new PolymorphicTypesRegistry();
103104
AutoRegisterTypes = options.AutoRegisterType;
105+
AllowAutoRegistrationOfRelations = options.AutoRegisterRelations;
104106
ActualOptions = options;
105107
SymmetricCipher = options.SymmetricCipher ?? new InvalidSymmetricCipher();
106108
FieldHandlerLogger = options.FieldHandlerLogger;

0 commit comments

Comments
 (0)