ASP.net MVC SimpleMembership

I am using SimpleMembership and I connected it to my User table and everything worked fine. But when I tried to change UserId from int to guid, I got an error:

Cannot convert type 'System.Guid' to 'int' 

For these lines of code:

  WebSecurity.CreateUserAndAccount(model.Email, model.Password, new { Name = model.Name, Surname = model.Surname, Gender = model.Gender, } ); 

In the webpages_OAuthMembership and webpages_Membership tables, I changed the UserId from int to uniqueidentifier (which represents guid), but didn't help.

So, can I have a pointer for the user ID, and if I can, how? And if I can’t use guid, can I use BIGINT?

+4
source share
1 answer

The idea of ​​SimpleMembershipProvider is that it is very easy to implement, since I usually work right out of the box. However, you should get along with your user table. If you want to use your own user table and possibly some self-encrypting / decrypting passwords, etc., you must create a CustomMembershipProvider. With this, you can customize everything to fit your existing environment or database.

0
source

All Articles