Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQ] Add Support for an id prefix or post fix #100

Closed
koddek opened this issue Mar 3, 2023 · 2 comments · Fixed by #117
Closed

[REQ] Add Support for an id prefix or post fix #100

koddek opened this issue Mar 3, 2023 · 2 comments · Fixed by #117

Comments

@koddek
Copy link

koddek commented Mar 3, 2023

Add support for adding a prefix and or postfix to the resulting guid ids.
There are some usecases where this would be useful for example, when dealing with json you could quickly identify what the id is for. In debugging an error message with an id or maybe you are trying to find a specific id of some type, having the prefix or postfix on the id would speed that up.

Possible resulting id strings (the final syntax don't have to be an underbar to separate the fix from the guid):

// ids with prefix for different usecases
"person_12345678-BBBb-cCCCC-0000-123456789012"
"user_12345678-BBBb-cCCCC-0000-123456789012"
"reciept_12345678-BBBb-cCCCC-0000-123456789012"
"used_12345678-BBBb-cCCCC-0000-123456789012"
"new_12345678-BBBb-cCCCC-0000-123456789012"
"[enter needed prefix]_12345678-BBBb-cCCCC-0000-123456789012"
etc...

// ids with postfix for different usecases
"12345678-BBBb-cCCCC-0000-123456789012_user"
"12345678-BBBb-cCCCC-0000-123456789012_admin"
"12345678-BBBb-cCCCC-0000-123456789012_order"
"12345678-BBBb-cCCCC-0000-123456789012_customer"
"12345678-BBBb-cCCCC-0000-123456789012_[enter needed postfix]"
@Dreamwalker666
Copy link

are you just talking about JSON serialisation here? don't see how it applies else where

@andrewlock
Copy link
Owner

Yeah, you're describing using custom converters her. That's a nice idea, but I'm not sure it should be in the core library.

Luckily in #117 I'm working on allowing much more customisation, so you should be able to create your own converters that work as you describe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants