180 likes | 312 Vues
Discover how to improve and modernize your enterprise web applications using EF Code-First Migrations in ASP.NET MVC. This guide covers essential concepts like models and mapping, DBContext configuration, connection strings, enabling migrations, and the complete workflow of updating the database through code. Learn how to streamline your development process with CI servers for effective database management, ensuring your application remains up-to-date with the latest changes. Access valuable resources for a deeper understanding and implementation of these technologies.
E N D
Data Access Layer Shahed Chowdhuri Using Code-First Migrations
Introduction Enterprise Web Application • Looking for Ways to Improve & Modernize • Motivation behind this design? ASP.NET MVC • Our desire to do the following: DB
Tech Check EF Code-First Migrations Are you familiar with…? Entity Framework EF Code-First Development ASP .NET MVC
1. Models & Mapping DBContext .OnModelCreating()
4. Update Database model code migration code dev DB migration code + seed (sql)
5. Push Code + Migrate Server DB code push code code pull code CI Server DB migrate.exe
6. Process Workflow communication DB DB architects dev team
Resources • EF Code First Migrations on MSDN: • http://msdn.microsoft.com/en-US/data/jj591621 • Web.config & configSource: • http://wakeupandcode.com/all-your-database-are-belong-to-us/ • PluralSight EF Migrations video tutorial: • http://pluralsight.com/training/Courses/TableOfContents/efmigrations