Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do VS Database projects and Entity Framework work together?

I've always been intrigued by Visual Studio Database Projects, and while they seem to be quite capable, I've never used them to any great degree outside of simplistic proof-of-concept work. I want to try this for a new project, and I'm also interested in using an EF layer on top of it, but in past test projects this has involved some decent effort.

I'm curious: has Visual Studio matured its product integration to support a single workflow that builds the database project, builds the EF layer on top of it, and finally builds the code, without intermediate steps involved?

We are a small team and we don't have dedicated SQL developers, and our primary goal is to bring the database into Visual Studio and to get it nicely under source control (TFS), and to achieve strong integration between from end to end. We're interested in growing into EF, and will probably start simple by treating it like a simple ORM tool to begin with if possible.

Has anyone actually done this that can provide insight into the process?

like image 420
bwerks Avatar asked Mar 15 '13 19:03

bwerks


People also ask

Does Entity Framework Create database?

However, with ASP.NET you can use Entity Framework to generate a database based on an object model. Generally you would create an ER diagram and manually create all the tables one by one. With Entity Framework, you can create your entities in Visual Studio and all your tables will be created for you.

When should I use Entity Framework?

The Entity Framework enables developers to work with data in the form of domain-specific objects and properties, such as customers and customer addresses, without having to concern themselves with the underlying database tables and columns where this data is stored.


1 Answers

We have used VS2014, tool seem much the same and early version Don't think has been much changes over the years

We have EDMX model and a DB project in the solution Does mean that you need to keep the db project up to date. But this is easy to do, you just publish you EDMX to local box/target Then can import the changes with a schema compare of local to the project.

So they you can still have Model driven DB design And use the DB project to deploy changes to the Dev/Stage/Live boxes And can publish with automated deployments also.

The db project has a post build scripts option Where you can use it to do seed data And also a pre-build where you can do db manipulation if need to change structure and types of fields types when the data is on a live db.

Schema compare tool are rather good in Visual Studio Can compare a DB to DB, DB to Project, or Schema file to either also

like image 140
True Solutions Avatar answered Oct 09 '22 21:10

True Solutions