-
Notifications
You must be signed in to change notification settings - Fork 25
Configurations
To make life simpler, as of v12.0, there's a Configuration
namespace that you could include to ease switching parts out and to configure the database.
Example
using SisoDb.Configurations;
db.Configure()
.UseAutoIds()
.PreserveIds()
.UseManualIds()
.UseGuidStructureIdGeneratorResolvedBy(structureSchema => new MyCustomGuidIdGenerator())
.UseSerializer(new MyCustomSerializer())
.UseCacheProvider(new MyCustomCacheProvider())
.StructureType<Foo>(cfg => cfg.AllowNestedStructures())
.StructureType<Bar>(cfg => cfg.OnlyIndexThis(x => x.Key))
.ForProduction();
If an Id exists it will be left untouched, otherwise a new ID will be generated.
GUID and String Ids should have been assigned. Identities will be generated for you.
No Ids will be generated. You are responsible for doing it.
Lets you hook in a Func
that determines which StructureIdGenerator
to use for GUIDs
. You also get the StructureSchema
so that you can do this per type.
Basically just assigns a new serializer to the Db.
Basically just assigns a new cache-provider to the Db.
Allows you to manually control how certain structures should be indexed.
Will not allow upsert of new tables nor will it perform any synchronization of schema changes. It does this by setting values on settings described here.