sql - Entity framework model creation -


There are two ways to basically create your model while using an entity framework. You create models in either SQL Server or in Visual Studio EF Designer. They are given below

Start from the database

If you first make a model in your SQL Server DB, then talk about EF to create an ADMX file for you. Using this approach, you can use SQL Server Management Studio to create all your models and relationships.

Get started with the Visual Studio EF Designer

This approach is to create the first model in the view of the studio and create its own database. By doing so, it seems that you have a choice of tables and relationships. There is no need to be concerned about.

Here's what I do and why do I do this

I'm starting to create my model using SQL Server Management Studio because I think that Using that tool is easy to create and modify tables, I also know what is being made. When I make my EF model by pointing to my existing database, then I will make that my database is written in the files that I keep in version control. When I need to make changes, I change the database and then update my .mmx file as well as my database project.

I was thinking that what are the professional and the opposition for these different methods and what should be the decision to use the benchmark? Am I doing it wrong? Do I want to make my model first in Visual Studio?

I do not think this is right 'or' wrongly ', it's a lot Depends on how you deploy your code, where it goes etc There is even a third way, which Scott Guthrie blogged recently:


As a side note, even if you are a model designer , I think that you always have to think about your tables / relationships, because this database is going wrong, that you can get big problems coming down from the front line.


Comments