Presentation is loading. Please wait.

Presentation is loading. Please wait.

Entity Framework Code First End to End

Similar presentations


Presentation on theme: "Entity Framework Code First End to End"— Presentation transcript:

1 Entity Framework Code First End to End
Visual Studio Live! Las Vegas 2013 Entity Framework Code First End to End Sergey Barskiy Architect, Tyler Technologies Level: Introductory to Intermediate © Visual Studio Live! All rights reserved.

2 Visual Studio Live! Las Vegas 2013
Introduction to EF Entity Framework in Microsoft’s ORM Tool Has been out since 2008 Code First has been out since 2011 © Visual Studio Live! All rights reserved.

3 Why Entity Framework Code First
Visual Studio Live! Las Vegas 2013 Why Entity Framework Code First ORM Code / type safety Rapid application development and prototyping Supported and developed by Microsoft Continuous commitment from Microsoft Open sourced Testable Flexible / Conventions and configurations © Visual Studio Live! All rights reserved.

4 Visual Studio Live! Las Vegas 2013
Approaches DAL? Business Layer? UI? © Visual Studio Live! All rights reserved.

5 Separation of Concerns
Visual Studio Live! Las Vegas 2013 Separation of Concerns EF is DAL technology Isolation from other layers Patterns Repository Data Mapper Table Data Gateway Row Data Gateway © Visual Studio Live! All rights reserved.

6 Visual Studio Live! Las Vegas 2013
DAL Strategy Keep Data (Table) Objects clean Separate data access from DTOs Create Access Interface Expose Data Access in a service layer with business objects Using Mappers to cut down on code © Visual Studio Live! All rights reserved.

7 Visual Studio Live! Las Vegas 2011
Developing Model Configuration Options Configuration classes Attributes? Handling Relationships Relationship Types Using foreign key columns Using Complex types Legacy databases / explicit mappings 2012 Visual Studio Live! All rights reserved.

8 Creating Data Access Layer
Visual Studio Live! Las Vegas 2011 Creating Data Access Layer Repository Pattern Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects. Interface based repository CQRS Write vs. Read Repository Taking dependency on IQueryable? 2012 Visual Studio Live! All rights reserved.

9 Working with Views and Stored Procedures
Visual Studio Live! Las Vegas 2011 Working with Views and Stored Procedures EF is not all-or-nothing answers Writing classes for materialization Avoiding SQL injection 2012 Visual Studio Live! All rights reserved.

10 Handling Schema Changes
Visual Studio Live! Las Vegas 2011 Handling Schema Changes Code First Migrations Create database Maintain schema Command line migrations Explicit vs. Implicit Migrations Initializers (for rapid prototyping) Migrating initializer 2012 Visual Studio Live! All rights reserved.

11 Visual Studio Live! Las Vegas 2011
Performance Caching Context Web environments CRUD Efficiencies Update Delete Select Lazy Loading Beware of multiple queries 2012 Visual Studio Live! All rights reserved.

12 Visual Studio Live! Las Vegas 2013
Demo Solution ASP.NET MVC Layer Separation via Projects © Visual Studio Live! All rights reserved.

13 Visual Studio Live! Las Vegas 2011
Contact Info 2012 Visual Studio Live! All rights reserved.


Download ppt "Entity Framework Code First End to End"

Similar presentations


Ads by Google