What generates the value of an int primary key for users with ASP.NET Identity 2?

流过昼夜 提交于 2019-12-13 20:33:42

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!