I'm trying to understand why the new ASP.NET Identity tables stopped using Guid
(uniqueidentifier type) as keys - instead it is now using nvarchar(128)
but still keep a Guid
as a string
...
Isn't it a huge waste? (uniqueidentifier
is just 2 integers
vs the whole Guid
as a 36 character string
)
I'm suspecting that Entity Framework might be responsible for this...
Is it safe to change back to uniqueidentifier keys?
Can anyone tell me what are the benefits of using 36 character strings?
Identity is built to work on multiple storage platforms and not every storage platform has Guid as a supported storage type.
You can change the default string pkey into Guid, but that involves some work on your C# models. Or you can change the pkey into an int - whatever you like. Just be aware that there is a huge debate about which is better.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With