After I've followed this to change the type of Application User Id from string to int, I get SqlException if I try to create a new user.
The exact error is:
Cannot insert the value NULL into column 'Id' table 'DBNAME.dbo.AspNetUsers'; column does not allow nulls. INSERT fails. The statement has been terminated.
Line 208: };
Line 209:
Line 210: var result = await UserManager.CreateAsync(user, model.Password);
Line 211: if (result.Succeeded)
Line 212: {
Source File: C:\Projects\ProjectName\ProjectName\Controllers\MembersController.cs Line: 210
[SqlException (0x80131904): Cannot insert the value NULL into column 'Id', table 'DBNAME.dbo.AspNetUsers'; column does not allow nulls. INSERT fails.
The statement has been terminated.]
Here is the screenshot of AspNetUsers table design view:
I've looked at How to tell the primary key 'Id' of IdentityUser class is IDENTITY(1,1)? and ASP.NET Identity - Error when changing User ID Primary Key default type from string to int AND when using custom table names but couldn't help me much.
Any help is very much appreciated.