1

I found this post on using the simple membership provider that ships with MVC 4.

Using MVC 4 SimpleMembership with an existing database-first EF model

I already have a data layer set up using IOc etc using the ef code first approach. Every thing is pretty clean at the moment and I want to keep it that way. The above post is great and explains a lot but there is one question that is not answered...

HOW DOES THIS FIT IN WITH CODE FIRST MIGRATIONS (Sorry for the caps)

The point I am making is currently my entities are mapped to the database, when I make changes to the entities the database updates, I can add seed data etc.

Now how do the membership tables that are created fit in to all of this.

Do they get created each time I run the application? What order are the tables created in? i.e. My custom tables then the membership ones. When does the seed code run?

Any ideas?

One last thing the post says that you need to provide a connection 'string'... and you cant use your ef entities to get the connection string..

I do not want to have a direct reference from the MVC site directly to the database even if that is just a connection string... surely this should come via a service?

1
  • You may be able to find your answer here, though the answer seems to be that there is no way to do this cleanly: stackoverflow.com/questions/11484969/… Commented Feb 9, 2014 at 1:25

0

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.