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

Slides:



Advertisements
Similar presentations
Introduction to NHibernate By Andrew Smith. The Basics Object Relation Mapper Maps POCOs to database tables Based on Java Hibernate. V stable Generates.
Advertisements

Getting Started with Oracle and .NET
Michael Pizzo Software Architect Data Programmability Microsoft Corporation.
CSLA Presenter Sergey Barskiy, senior consultant at Magenic Technologies your questions Send an in order.
Object Relational Mapping. What does ORM do? Maps Object Model to Relational Model. Resolve impedance mismatch. Resolve mapping of scalar and non-scalar.
A Guide to SQL, Seventh Edition. Objectives Understand the concepts and terminology associated with relational databases Create and run SQL commands in.
The Microsoft Technical Roadshow 2007 Advances for Data in VS “Orcas” Mike Taulty Developer & Platform Group Microsoft Ltd
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
ORM Technologies and Entity Framework (EF)
© Internna Technologies 1 IWebMvc Features, Possibilities & Goals.
Neo.NET Entity Objects Design Goals Copyright © Erik Dörnenburg – Last updated: May 2004.
Creating Data Marts from COBOL Files (ISAM to RDBMS)
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.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 7-1 David M. Kroenke’s Chapter Seven: SQL for Database Construction and.
Database Design for DNN Developers Sebastian Leupold.
Entity Framework, a quickstart Florin−Tudor Cristea, Microsoft Student Partner.
What is Architecture  Architecture is a subjective thing, a shared understanding of a system’s design by the expert developers on a project  In the.
Part 06 – A More Complex Data Model Entity Framework and MVC NTPCUG Tom Perkins.
Converting COBOL Data to SQL Data: GDT-ETL Part 1.
NHibernate in Action Web Seminar at UMLChina By Pierre Henri Kuaté 2008/08/27
CHAPTER 14 USING RELATIONAL DATABASES TO PROVIDE OBJECT PERSISTENCE (ONLINE) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database.
IE 423 – Design of Decision Support Systems Data modeling and database development.
Security David Frommer Principal Architect Business Intelligence Microsoft Partner of the Year 2005 & 2007.
Recent research : Temporal databases N. L. Sarda
SQL Server 7.0 Maintaining Referential Integrity.
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
Objectives In this lesson, you will learn to: *Identify the need for ADO.NET *Identify the features of ADO.NET *Identify the components of the ADO.NET.
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
Chapter 38 Persistence Framework with Patterns 1CS6359 Fall 2011 John Cole.
EntityFrame work and LINQ CH 14. linq LINQ enables you to query data from a wide variety of data sources, directly from your programming code. LINQ is.
Constraints cis 407 Types of Constraints & Naming Key Constraints Unique Constraints Check Constraints Default Constraints Misc Rules and Defaults Triggers.
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
SimDB Implementation & Browser IVOA InterOp 2008 Meeting, Theory Session 1. Baltimore, 26/10/2008 Laurent Bourgès This work makes use of EURO-VO software,
What is MySQL? MySQL is a relational database management system (RDBMS) based on SQL (Structured Query Language). First released in January, Many.
Peter Peng. Agenda Introducing A simple example More complex examples (in part 2) Developing (in part 3)
Declarative Languages and Model Based Development of Web Applications Besnik Selimi South East European University DAAD: 15 th Workshop “Software Engineering.
Entity Framework Code First – Beyond the Basics Sergey Barskiy, Magenic Microsoft MVP – Data Platform Magenic, Principal Consultant Level: Introductory.
© 2012 Saturn Infotech. All Rights Reserved. Oracle Hyperion Data Relationship Management Presented by: Prasad Bhavsar Saturn Infotech, Inc.
Relational Database Management System(RDBMS) Structured Query Language(SQL)
Simplifying the Code First Approach in the Entity Framework Dhananjay Kumar Infragistics Consultant Microsoft MVP
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
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
 CONACT UC:  Magnific training   
SQL Basics Review Reviewing what we’ve learned so far…….
1 Copyright © 2008, Oracle. All rights reserved. Repository Basics.
Planning a Migration.
Top 10 Entity Framework Features Every Developer Should Know
Introduction to Entity framework
EF Code First (Advanced)
Working in the Forms Developer Environment
Entity Framework: Code First
Entity Framework: Relations
 .NET CORE
Entity Framework By: Casey Griffin.
Entity Framework Core for Enterprise Applications
Learn. Imagine. Build. .NET Conf
ADO.NEXT Advances in Data Access for 2008
Implementing Data Models & Reports with Microsoft SQL Server
.NET Database Technologies:
Entity Framework Core (EF Core)
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 Principal Consultant

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

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

Code First Migrations DbMigration API – Index – Rename Update-Database –TargetMigration: (can be used to rollback) Migrate.exe Create script

Performance Caching Context Web environments CRUD Efficiencies – Update – Delete – Insert – Select When used in services, disable – Lazy Loading – Proxy Creation

Performance Auto Compiled Queries (v5), etc… View generation – power-tools-beta-2-available.aspx power-tools-beta-2-available.aspx Lazy vs. Eager Loading White Paper us/data/hh949853http://msdn.microsoft.com/en- us/data/hh Upgrade server to.NET 4.5 to take advantage

DbEntityEntry State Current, Original, Database values ComplexProperty 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 Properties

Relationships All are supported One-to-one needs explicit configuration Cascading deletes

More… Working with Views and Stored Procedures

More… Create your own repository Create/Update/Delete Select Conventions – Creating your own conventions – V6 Preview

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

Contact Info