如何避免在 asp.net mvc 身份表中使用 GUID (As UserId) 作为主键?

How to avoid using GUID (As UserId) as primary key in asp.net mvc identity tables?

asp.net 身份框架自动生成字符串 GUID 作为 AspNetUser table 中的主键。我如何强制系统改用 int?

因为根据这个线程What are the best practices for using a GUID as a primary key, specifically regarding performance?,使用 GUID 作为主键会导致性能损失。

您不需要在主键上有聚簇索引。您还可以找到告诉您使用 GUID 作为主键的链接。