Fork me on GitHub

Guid Identifiers Edit on GitHub


As of Marten 1.0-alpha, the default Guid mechanism is a sequential or "Comb" Guid. While more expensive to generate, this makes inserts into the underlying document tables more efficient.

CombGuid

To use CombGuid generation you should enabled it when configuring the document store. This defines that the CombGuid generation strategy will be used for all the documents types.


options.DefaultIdStrategy = (mapping, storeOptions) => new CombGuidIdGeneration();

It is also possible use the SequentialGuid id generation algorithm for a specific document type.


options.Schema.For<UserWithGuid>().IdStrategy(new CombGuidIdGeneration());