You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently different types of Guid are supported, such as
Guid.NewGuid()
MassTransit.NewId
GuidComb
There's also this open issue to support Ulid.
At some point UUID v7 and v8 specs will likely need to be included.
Solution
I think it might be great if we could have a more relaxed approach to generating ids.
Something like this:
// Id type[Strongly(newIdGenerator:typeof(MyCustomIdGenerator))]publicreadonlypartialstruct SomeId;// Id generatorpublicstaticclassMyCustomIdGenerator{publicstatic Guid New()=> NewId.NextSequentialGuid();}
Th generated code can use the fully qualified name of MyCustomIdGenerator to call the static method New().
Problem
Currently different types of Guid are supported, such as
Guid.NewGuid()
MassTransit.NewId
GuidComb
There's also this open issue to support Ulid.
At some point UUID v7 and v8 specs will likely need to be included.
Solution
I think it might be great if we could have a more relaxed approach to generating ids.
Something like this:
Th generated code can use the fully qualified name of
MyCustomIdGenerator
to call the static methodNew()
.This way the id can be generated in whatever way it's needed, no need to create a new Id type for each possible case.
The text was updated successfully, but these errors were encountered: