Reputation: 523
I'm a bit confused when creating/organizing an Entity Data Model in Visual Studio.
Currently I am creating a custom User Login page to go along with my existing database. When I created the Data Model, I go through the generation wizard log into the database, and then it asks what tables I want to include.
I ended up selecting the user tables and the roles and user type tables and was able to successfully authenticate and such.
Now I want to add additional functionality and call to other tables in my database. Should I be creating a brand new Entity Data Model? Or should I just select all the tables in my database?
Upvotes: 2
Views: 829
Reputation: 3764
As someone who likes to write my code, i would encourage you to work with Entity Framework Code First
. Unless, you have all your app planned out, this is the best approach as it simplifies making database changes very easy.
It looks like you have either been doing Model First
or Database First. To see the differences between all 3 of them See This Post
Since you mentioned login, i should also advise to use the built in Simple Membership
. You can integrate it into your current model with easy.
I recently answered this question on Simple Membership and provided some links that helped me once.
If you have questions, i would be happy to answer them.
Upvotes: 1
Reputation: 836
Unless your database is huge, I would just keep everything in the same EDM, it will make it easier to do joins, and traverse the relationships. You can however have multiple EDMs share a context.
[2] Multiple/Single *.edmx files per database
[3] http://forums.asp.net/post/3591202.aspx
Upvotes: 1