I am supposed to generate a partial random unique id to be stored as an identifier for users.
Criteria:
- 8 digits
- First 4 digits is of my own (for eg. the year)
- Last 4 digits can be anything random.
How do I use entity framework to make sure this id is unique? I don't want to have a loop that generates then check the database. Can something like this be done in 1 database call?