MySQL Forums
Forum List  »  MySQL for Visual Studio

How to change primary key for Identity with MySQL as storage provider
Posted by: Shyamal Parikh
Date: August 14, 2015 12:09PM

I followed this link http://www.asp.net/identity/overview/extensibility/implementing-a-custom-mysql-aspnet-identity-storage-provider

and worked out how to make MySQL work with aspnet.Identity 2.2.1

However, as soon as I try follow the link: http://www.asp.net/identity/overview/extensibility/change-primary-key-for-users-in-aspnet-identity

I come to this instruction -->

Change the context class and user manager to use the key type

In IdentityModels.cs, change the definition of the ApplicationDbContext class to use your new customized classes and an int for the key, as shown in the highlighted code.

public class ApplicationDbContext : IdentityDbContext<ApplicationUser, CustomRole,
int, CustomUserLogin, CustomUserRole, CustomUserClaim>
{

However, for MySQL storage provider to work as per http://www.asp.net/identity/overview/extensibility/implementing-a-custom-mysql-aspnet-identity-storage-provider

I had changed the above code from

public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
to

public class ApplicationDbContext : MySQLDatabase

So here, I am facing a problem, there is no extension that MySQLDatabase accepts as IdentityDbContext does. Can anyone please help me out here?

Options: ReplyQuote


Subject
Views
Written By
Posted
How to change primary key for Identity with MySQL as storage provider
1653
August 14, 2015 12:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.