How to change type of id in Microsoft.AspNet.Identity.EntityFramework.IdentityUser

后端 未结 5 887
既然无缘
既然无缘 2020-11-27 10:44

(ASP.NET MVC 5, EF6, VS2013)

I\'m trying to figure out how to change the type of the \"Id\" field from string to int in the type:

Mi         


        
5条回答
  •  清歌不尽
    2020-11-27 11:11

    As stated here:

    In Visual Studio 2013, the default web application uses a string value for the key for user accounts. ASP.NET Identity enables you to change the type of the key to meet your data requirements. For example, you can change the type of the key from a string to an integer.

    This topic on the above link shows how to start with the default web application and change the user account key to an integer. You can use the same modifications to implement any type of key in your project. It shows how to make these changes in the default web application, but you could apply similar modifications to a customized application. It shows the changes needed when working with MVC or Web Forms.

提交回复
热议问题