Why did the new ASP.NET Identity tables stop using Guid (uniqueidentifier type) as keys?

asp.net asp.net-identity entity-framework entity-framework-6

Question

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?

1
7
8/21/2015 8:13:43 AM

Accepted Answer

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.

2
5/23/2017 11:53:47 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow