MVC5 identity stores userId in a string, but WHY?
If you don't feel like answering THE question you can just post random links how to store user id'z as int's...
MVC5 identity stores userId in a string, but WHY?
If you don't feel like answering THE question you can just post random links how to store user id'z as int's...
Well, you seem to be quite rude for someone who is quite wrong.
ASP.NET Identity does NOT use strings for Id, it just uses strings for Id by default in the template generated by visual studio for a "starter project". You can use whatever you want for Id by defining a new IdentityUser type. Just like you aren't stuck with using the supplied templates for your views, or controllers, or anything else.
See https://stackoverflow.com/a/23573049/61164
The reason it uses strings is because the default identity type in the starter project template is a Guid, which not all database types support (remember, it supports more than just SQL Server). So, it uses strings to store them for compatibility reasons.
Well I guess it uses a different scheme for Id
If you will check your Database, a sample Id Looks like this
"62e41fbc-dbd6-41d2-8209-0fdf29fb1908"
Assuming this is hash or encrypted value.
If you want to store them as integer or make a Id Count, you can just add another entry to the table (ASPUserId) then make it an int then increment every time you make an entry