Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


I 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/authen...


I 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.


Why would you want to.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: