Presentation is loading. Please wait.

Presentation is loading. Please wait.

Stuart Leitch www.stuartleitch.com “Code First” & DbContext.

Similar presentations


Presentation on theme: "Stuart Leitch www.stuartleitch.com “Code First” & DbContext."— Presentation transcript:

1 Stuart Leitch www.stuartleitch.com “Code First” & DbContext

2 ObjectContext DbContext DbSet ObjectSet Entity Client Conceptual / Mapping / Logical  Should have been V1  Simplifies  Discoverability  Does not replace Needed backward compatibility Wraps ObjectContext ObjectContext accessible  Recommended for all approaches Use ObjectContext only when needed.

3  Database First  Model First  Code First

4  Existing Database / DBA  Maximum control  Full T4 Template support (Self Tracking etc.)  Not great with large models (50+ tables)  Source Control merging headaches (XML)

5  Generate Database / Migrate  Like to “Draw” model / Designer Fan  Less database centric  Full T4 Template support  Source Control merging nightmare (XML)

6  Code Oriented / Dumb down DB  No automated migration support (vNext)  No T4 Template support / Self Tracking (yet)  Source Control Branch friendly  Cross EDMX easy  No SP’s, Compiled Queries

7  Demo scenario / Client Brief  Creating the model in Code Basics & conventions Data annotations / Fluent API Relationships, inheritance, hierarchies & complex types Database generation & Seed data  Using the model with DbContext LINQ, Find / Local (cached) Lazy Loading, Prefetching Concurrency Common Patterns

8  Web store with orders

9

10  RTW releases this month (likely at MIX)  Coming soon: Self Tracking Entities Migrations Enum Support Stored Procedure Support


Download ppt "Stuart Leitch www.stuartleitch.com “Code First” & DbContext."

Similar presentations


Ads by Google