16
Data Access Layer Shahed Chowdhuri Using Code-First Migrations

Data Access Layer

  • Upload
    brie

  • View
    41

  • Download
    1

Embed Size (px)

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 Presentation

Citation preview

Page 1: Data Access Layer

Data Access Layer ShahedChowdhuriUsing Code-First Migrations

Page 2: Data Access Layer

Thanks to our Sponsorsfor keeping the fires lit

Page 3: Data Access Layer

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:

Page 4: Data Access Layer

Tech Check

ASP.NETMVC

EntityFramework

EF Code-First

Development

EF Code-First Migrations

Are you familiar with…?

Page 5: Data Access Layer

Options and Alternatives

Database-First

(EDMX)

Model-First

(Visual Designer)

Code-First (automatic migrations)

Code-First (manual

migrations)

Page 6: Data Access Layer

What are we trying to solve?

Page 7: Data Access Layer

DAL: Agenda

1. Models & Mapping

2. Connection Strings

3. Enable Migrations

4. Update Database

5. Push Code + Migrate Server DB

6. Process Workflow

Page 8: Data Access Layer

1. Models & MappingDBContext.OnModelCreating()

Page 9: Data Access Layer

2. Connection Strings

Page 10: Data Access Layer

3. Enable Migrations

Page 11: Data Access Layer

migration code

4. Update Database

model code

migration code + seed

devDB

(sql)

Page 12: Data Access Layer

5. Push Code + Migrate Server DBcode push code

CI

code pull code

migrate.exeServerDB

Page 13: Data Access Layer

6. Process Workflow

dev team DB architects

communication

DB

Page 14: Data Access Layer

Code Walkthrough

Page 15: Data Access Layer

DAL: Conclusion

Code-First Migrations

Dev Team Synchronized

Server DeploymentDatabase

Versioning

Continuous Development

Page 16: Data Access Layer

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