data access layer
DESCRIPTION
Data Access Layer. Shahed Chowdhuri. U sing Code-First Migrations. Thanks to our Sponsors for keeping the fires lit. Introduction. Enterprise Web Application. Looking for Ways to Improve & Modernize. Motivation behind this design?. ASP.NET MVC. Our desire to do the following:. DB. - PowerPoint PPT PresentationTRANSCRIPT
Data Access Layer ShahedChowdhuriUsing Code-First Migrations
Thanks to our Sponsorsfor keeping the fires lit
TDD (Test Driven Development)
BDD (Behavior Driven Development)
CI (Continuous Integration)
CD (Continuous Delivery)
Introduction
ASP.NETMVC
DB
EnterpriseWebApplication
Looking for Ways to Improve & Modernize
Motivation behind this design? Our desire to do the following:
Tech Check
ASP.NETMVC
EntityFramework
EF Code-First
Development
EF Code-First Migrations
Are you familiar with…?
Options and Alternatives
Database-First
(EDMX)
Model-First
(Visual Designer)
Code-First (automatic migrations)
Code-First (manual
migrations)
What are we trying to solve?
DAL: Agenda
1. Models & Mapping
2. Connection Strings
3. Enable Migrations
4. Update Database
5. Push Code + Migrate Server DB
6. Process Workflow
1. Models & MappingDBContext.OnModelCreating()
2. Connection Strings
3. Enable Migrations
migration code
4. Update Database
model code
migration code + seed
devDB
(sql)
5. Push Code + Migrate Server DBcode push code
CI
code pull code
migrate.exeServerDB
6. Process Workflow
dev team DB architects
communication
DB
Code Walkthrough
DAL: Conclusion
Code-First Migrations
Dev Team Synchronized
Server DeploymentDatabase
Versioning
Continuous Development
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