1

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,

0

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, it's for single time use when moving from one version to another. A new MySQL EF project does not need this in it's constructor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.