-
Notifications
You must be signed in to change notification settings - Fork 81
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
Implement missing Guid(string) constructor #64
Comments
I can understand why you want it, but I'm not very inclined to add it, as otherwise why not allow it for ints, longs, all the other types. Where's the line? Why not also |
those base types don't have a constructor of type
Good idea.
I have the issue with migrating existing unit tests.
Using the converter would be even more code in the unit tests then using the existing constructors. |
If you have to migrate a lot of unit tests, it might be a symptom of poorly written fixtures, that could need improvement. But other than that, i do agree that it's nice to have the direct constructor to make the API of the Ids more userfriendly. |
In my case it's a poorly written SQL database, where almost every table uses a GUID as the primary key. |
For feature requests like this, I think I've found an answer in the big redesign of the library in this PR: The main idea is to make the library much more maintainable while also giving people a mechanism to customise the generated IDs as much as they like. This will make it easy to make changes like this 🙂 |
When implementing a type like
Then instead of
I want to write
The text was updated successfully, but these errors were encountered: