问题
It's my understanding with ASP.NET Identity 2 you will be able to have a PK of int for Users and Roles. I like the idea of this very much.
But currently ASP.NET Identity 1.0 seems to generate a GUID which is converted to a string. I understand how to change to the PK being an int but what else is needed. If my PK's are integers then will it create an integer ID for me automatically when I create a new user ?
回答1:
EF by default knows how to generate int identities unlike Guids, so you shouldn't have to do anything regarding key generation once you switch the primary key type to integer.
来源:https://stackoverflow.com/questions/20861461/what-generates-the-value-of-an-int-primary-key-for-users-with-asp-net-identity-2