Using Visual Studios 2010 I'm creating a project that has a database.
I decided to try to use one of those Database Projects that allow you to manage the database in source control along with the code.
I also think I will use entity framework as my data access tool.
Are there any good solution to tie the EF 4.0 project to the database being managed in the Database project (assuming it's a new db)?
EF Core works with many databases, including SQL Database (on-premises and Azure), SQLite, MySQL, PostgreSQL, and Azure Cosmos DB.
To use code-first for an existing database, right click on your project in Visual Studio -> Add -> New Item.. Select ADO.NET Entity Data Model in the Add New Item dialog box and specify the model name (this will be a context class name) and click on Add.
You simply use your database project to create database for you and you use Database first approach with Entity framework (that means you will use wizard and update from database to create entity model for you).
I found Scott Guthries 'Code-first' tutorial to be quite good:
http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx
Let me know if that doesn't quite scratch the itch, I've got a couple of others bookmarked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With