jomsk1e
jomsk1e

Reputation: 3625

ASP.NET MVC Identity EF using MySQL

I used code migrations using sql server. But on my new project, I am required to use MySQL. I followed every step into this tutorial, I think I get everything I needed but to this line:

public ApplicationDbContext()
        : base("DefaultConnection", throwIfV1Schema : false)

It has an error that says IdentityDbContext does not contain a constructor that takes 2 arguments.

I know what's the error is. But I searched about this 'throwIfV1Schema' and found out that some devs uses this line for migrations using MySQL. I don't know what's wrong with my project. Please help! Thanks,

Upvotes: 1

Views: 360

Answers (1)

heymega
heymega

Reputation: 9401

I believe the throwIfV1Schema parameter was added in version 2 to protect a login fault which some users experienced when migrating from Identity 1.x to 2.0.

It has since been removed from later versions, probably because the bug has been fixed. This is why you don't have a constructor which takes over a string and bool.

Sorry but I don't have any references to back this up but I remember looking at the same thing a while ago.

Upvotes: 1

Related Questions