4 ms·
Does Asp.NET identity still use a Guid for primary key? I remember it being hell trying to convert to int a few years ago which left a sour taste.
by dotnethell 6y ago
Does Asp.NET identity still use a Guid for primary key? I remember it being hell trying to convert to int a few years ago which left a sour taste.
- kgwxd 6y agoI think the default is a string now (nvarchar 450). Here's [1] a guide on changing the PK type, but the example uses Guid instead of string. I assume int could be used too, but I wonder if changing to db generated value would cause headaches/show-stoppers. [1] https://docs.microsoft.com/en-us/aspnet/core/security/authentication/customize-identity-model?view=aspnetcore-5.0#change-the-primary-key-type https://docs.microsoft.com/en-us/aspnet/core/security/authen...
- twooclock 6y agoI belive it uses guid (or a string that stores guid :-/) but it's fairly easy to change it to int. That's what I have in my boilerplate-kickstart template, anyway. Still I remember I was "surprised" too.
- Yuioup 6y agoWhy would you want to.