Skip to content

Why do we use strongly type Ids instead of simple primitive types? #176

Answered by pawelpodsiadly
mehdihadeli asked this question in Q&A
Discussion options

You must be logged in to vote

A quote from the article linked below

By using strongly-typed IDs like these we can take full advantage of the C# type system to ensure different concepts cannot be accidentally used interchangeably. Using these types in the core of your domain will help prevent simple bugs like incorrect argument order issues, which can be easy to do, and tricky to spot!

Using strongly-typed entity IDs to avoid primitive obsession

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mehdihadeli
Comment options

Answer selected by mehdihadeli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants