Entity Framework Code First – Beyond the Basics Sergey Barskiy, Magenic Microsoft MVP – Data Platform Magenic, Principal Consultant Level: Introductory.

Slides:



Advertisements
Similar presentations
Satisfy Your Technical Curiosity ADO.NET vNext The Entity Data Model, Object Services, and LINQ Bob Beauchemin Director of Developer Resources, SQLskills.
Advertisements

Introduction to NHibernate By Andrew Smith. The Basics Object Relation Mapper Maps POCOs to database tables Based on Java Hibernate. V stable Generates.
Native XML Database or RDBMS. Data or Document orientation If you are primarily storing documents, then a Native XML Database may be the best option.
Michael Pizzo Software Architect Data Programmability Microsoft Corporation.
.NET Database Technologies: Open-Source Frameworks.
Object Relational Mapping. What does ORM do? Maps Object Model to Relational Model. Resolve impedance mismatch. Resolve mapping of scalar and non-scalar.
WCF RIA Services - Querying and Updating Data SILVERLIGHTSHOW.NET WEBINARS SERIES BRIAN NOYES, CHIEF ARCHITECT, IDESIGN INC 2 FEB 2011.
The Microsoft Technical Roadshow 2007 Advances for Data in VS “Orcas” Mike Taulty Developer & Platform Group Microsoft Ltd
5 Copyright © 2004, Oracle. All rights reserved. Creating a Master-Detail Form.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
ORM Technologies and Entity Framework (EF)
Rice KRAD Data Layer JPA Design Eric Westfall July 2013.
CSE446 S OFTWARE Q UALITY M ANAGEMENT Spring 2014 Yazılım ve Uyguluma Geliştirme Yöneticisi Orhan Başar Evren.
Enterprise Object Framework. What is EOF? Enterprise Objects Framework is a set of tools and resources that help you create applications that work with.
Entity Framework Code First End to End
Building Data Driven Applications Using WinRT and XAML Sergey Barskiy, Magenic Microsoft MVP – Data Platform Principal Consultant Level: Intermediate.
.NET Database Technologies: Entity Framework additional notes – part 2.
Database Design for DNN Developers Sebastian Leupold.
LINQ Boot Camp ADO.Net Entity Framework Presenter : Date : Mahesh Moily Nov 26, 2009.
Entity Framework, a quickstart Florin−Tudor Cristea, Microsoft Student Partner.
Part 06 – A More Complex Data Model Entity Framework and MVC NTPCUG Tom Perkins.
Converting COBOL Data to SQL Data: GDT-ETL Part 1.
Eric Nelson (or )
NHibernate in Action Web Seminar at UMLChina By Pierre Henri Kuaté 2008/08/27
Database Technical Session By: Prof. Adarsh Patel.
IE 423 – Design of Decision Support Systems Data modeling and database development.
Recent research : Temporal databases N. L. Sarda
OVERVIEW ON HOW ENTITY FRAMEWORK CODE FIRST CAN EASE THE DEVELOPMENT PROCESS Entity Framework Code First 11/19/2013 Joe Walling Copyright Walling Info.
5 Copyright © 2004, Oracle. All rights reserved. Creating a Master-Detail Form.
Oracle Data Integrator Transformations: Adding More Complexity
“INTRODUCTION TO DATABASE AND SQL”. Outlines 2  Introduction To Database  Database Concepts  Database Properties  What is Database Management System.
Chapter 38 Persistence Framework with Patterns 1CS6359 Fall 2011 John Cole.
Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
Entity Framework Code First – Beyond the Basics Sergey Barskiy, Magenic Microsoft MVP – Data Platform Principal Consultant.
Oct * Brad Tutterow. VS 2008.NET 3.5LINQ Entity Framework  The ADO.NET Entity Framework is part of Microsoft’s next generation of.NET technologies.
Entity Framework: Code First SoftUni Team Technical Trainers Software University
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
DEV383 The ADO.NET DataSet and You Jackie Goldstein General Manager Renaissance Computer Systems
BI Practice March-2006 COGNOS 8BI TOOLS COGNOS 8 Framework Manager TATA CONSULTANCY SERVICES SEEPZ, Mumbai.
What is MySQL? MySQL is a relational database management system (RDBMS) based on SQL (Structured Query Language). First released in January, Many.
© 2012 Saturn Infotech. All Rights Reserved. Oracle Hyperion Data Relationship Management Presented by: Prasad Bhavsar Saturn Infotech, Inc.
Towards Unifying Vector and Raster Data Models for Hybrid Spatial Regions Philip Dougherty.
Entity Framework 7: What’s New? Ricardo Peres Technical Evangelist at Simplifydigital. Microsoft
Stuart Leitch “Code First” & DbContext.
ORM Basics Repository Pattern, Models, Entity Manager Ivan Yonkov Technical Trainer Software University
Physical Layer of a Repository. March 6, 2009 Agenda – What is a Repository? –What is meant by Physical Layer? –Data Source, Connection Pool, Tables and.
Hibernate Online Training. Introduction to Hibernate Hibernate is a high-performance Object-Relational persistence and query service which takes care.
SQL Basics Review Reviewing what we’ve learned so far…….
1 Copyright © 2008, Oracle. All rights reserved. Repository Basics.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
DAT 390 Advanced ADO.NET Programming Techniques Jackie Goldstein Renaissance Computer Systems
© 2016, Mike Murach & Associates, Inc.
Top 10 Entity Framework Features Every Developer Should Know
Introduction to Entity framework
Working in the Forms Developer Environment
Entity Framework: Code First
Entity Framework: Relations
Efficiently Searching Schema in SQL Server
Entity Framework By: Casey Griffin.
Entity Framework Core for Enterprise Applications
Learn. Imagine. Build. .NET Conf
ADO.NET Entity Framework
ADO.NEXT Advances in Data Access for 2008
Implementing Data Models & Reports with Microsoft SQL Server
.NET Database Technologies:
Entity Framework Core (EF Core)
Jeff Webb Maria Baron Chris Hundersmarck
Data Model.
IT College 2016, Andres käver
Entity Framework Core for Enterprise Applications
Presentation transcript:

Entity Framework Code First – Beyond the Basics Sergey Barskiy, Magenic Microsoft MVP – Data Platform Magenic, Principal Consultant Level: Introductory / Intermediate

Entity Framework Code First Entity Framework in Microsoft’s ORM Tool Has been out since 2008 Code First has been out since 2011

Performance Understanding of Caching Context Metadata and query commands View Generation Precompiled Views (4.x vs. 5.0) Limit Complexity of views Limit data Limit scope of context (using()) Lazy Loading pitfalls

Performance CRUD Efficiencies –Update –Delete –Insert –Select (No Tracking)

DbEntityEntry State Current, Original, Database values ComplexProperty, Collection, Reference Entity Reload GetValidationResult Access to see if a scalar property was modified (requires all properties to be virtual)

Organizing the Model Hierarchies Table per hierarchy Types in an inheritance hierarchy are mapped to a single table. A condition clause is used to define the entity types Table per type Types are all mapped to individual tables. Properties that belong solely to a base type or derived type are stored in a table that maps to that type Table per concrete type Non-abstract types are each mapped to an individual table. Each of these tables must have columns that map to all of the properties of the derived type, including the properties inherited from the base type

Organizing the Model Complex Types A complex type is a non-scalar property of an entity type that does not have a key property. A complex type can contain other nested complex types. Entity Splitting Properties from a single entity in the conceptual model are mapped to columns in two or more underlying tables. Excluding Types and Properties Properties and/or classes are excluded from storage. Explicit Mapping of Types and Propeties

More… Relationships All are supported One-to-one needs explicit configuration Cascading deletes Working with Views and Stored Procedures

More… Create your own repository Create/Update/Delete Select Concurrency handling Conventions –Creating your own conventions

Handling Schema Changes Code First Migrations Create database Maintain schema Command line migrations Custom Migrations Using 3 rd Party tooling

Code First Migrations Enable automatic migrations Update-Database –Has to be run to create database Add-Migration –Add manual migration –Up / Down methods –Supplying default values for non-nullable columns MigrateDatabaseToLatestVersion

Custom Migrations Use third-party tooling –Quest –Red Gate –Etc… Write Custom Initializer

RDBMS Providers Available providers DevArt DataDirect Oracle MySQL.etc… Mileage may vary

Links us/library/cc aspx (Performance) us/library/cc aspx

Contact Info