It's not usual request: create a sequential GUID
, as by definition, GUID
is unique (as much as it possible) and presence of some mathematical, predictable sequence will introduce additional problems in its uniqueness support.
But, by the way, as usual, there is always someone that think about this already.
Seems that guy on this link had the same problem:
Generate Sequential GUID
Note: the code provided is for C# 2005
, but not much changed since that, in regard of this question at least.
EDIT
According to documentation, in regard of the sequential GUID generation:
Numeric or Guid Id properties are supported and will work seamlessly.
In this case, RavenDB will automatically make the translation between
the inner string ID to the numeric or Guid value shown in the entity
and back.
Using this approach, IDs are available immediately after calling Store
on the object - the RavenDB session will set a unique ID in memory
without asking one from the serve
That means even if it's generated by "server", its also stored in the memory, so ask for it will cost almost nothing, if this is your warry...