© Copyright SELA Software & Education Labs Ltd. 14-18 Baruch Hirsch St. Bnei Brak 51202 Israel Microsoft Entity Framework v1.1 over Oracle Database Erez.

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.
Language Integrated Query (LINQ) Martin Parry Developer & Platform Group Microsoft Ltd
Michael Pizzo Software Architect Data Programmability Microsoft Corporation.
.NET Database Technologies: Open-Source Frameworks.
DEVELOPING APPLICATIONS WITH LINQ 2 SQL Sidar Ok
.NET Framework V3.5+ & RESTful web services Mike Taulty Developer & Platform Group Microsoft Ltd
WCF RIA Services - Querying and Updating Data SILVERLIGHTSHOW.NET WEBINARS SERIES BRIAN NOYES, CHIEF ARCHITECT, IDESIGN INC 2 FEB 2011.
Performed by:Gidi Getter Svetlana Klinovsky Supervised by:Viktor Kulikov 08/03/2009.
Chapter 12 Database Connectivity with ASP.NET JavaScript, Third Edition.
A tour of new features introducing LINQ. Agenda of LINQ Presentation We have features for every step of the way LINQ Fundamentals Anonymous Functions/Lambda.
Discover, Master, InfluenceSlide 1 SQL Server Compact Edition and the Entity Framework Rob Sanders Readify.
Eric Nelson Developer & Platform Group Microsoft Ltd
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
Entity Framework Code First End to End
LINQ Boot Camp ADO.Net Entity Framework Presenter : Date : Mahesh Moily Nov 26, 2009.
BIT 286: Web Applications Lecture 04 : Thursday, January 15, 2015 ASP.Net MVC - Models.
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.
Eric Nelson (or )
Visual Studio 2010 and.NET Framework 4 Training Workshop.
ADO.NET DATA SERVICES Mike Taulty Developer & Platform Group Microsoft UK
Entity Framework Overview. Entity Framework A set of technologies in ADO.NET that support the development of data-oriented software applications A component.
Ventsislav Popov Crossroad Ltd.. 1. ASP.NET Data Source Controls  SqlDataSource  EntityDataSource  ObjectDataSource 2. Entity Data Model and ADO.NET.
Introduction to LINQ Lecture # 19 August Introduction How do you interrogate/manipulate data? What if you could do the work in a type-safe," string-free.
Lap Around Visual Studio 2008 &.NET 3.5 Enhancements.
Alcatel-Lucent CDC Workshop, Coaching & Knowledge Transfer Architecture.
© Copyright SELA software & Education Labs Ltd Baruch Hirsch St.Bnei Brak Israel
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.
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.
AUC Technologies LINQ (Language Integrated Query) LINQ Presented By : SHAIKH SHARYAR JAVED Software Engineer (Daedalus Software Inc.) Technology Teacher.
Ventsislav Popov Crossroad Ltd.. 1. ASP.NET Data Source Controls  SqlDataSource  EntityDataSource  ObjectDataSource 2. Entity Data Model and ADO.NET.
1 ADO.NET Data Services Mike Taulty Developer & Platform Group Microsoft Ltd
Database Connectivity with ASP.NET. 2 Introduction Web pages commonly used to: –Gather information stored on a Web server database Most server-side scripting.
Entity Framework Code First – Beyond the Basics Sergey Barskiy, Magenic Microsoft MVP – Data Platform Magenic, Principal Consultant Level: Introductory.
Linq Overview Vincent GERMAIN. Evolution - Rappel Langage  C# 2.0  C# 3.0 (Local type inference, Lambda expression, Method extension,Anonymous type)
ADO.NET 3.0 – Entity Data Model Gert E.R. Drapers Chief Software Architect Visual Studio Team Edition for Database Professionals Microsoft Corporation.
Language Integrated Query Mike Taulty Developer & Platform Group Microsoft Ltd
ORM Basics Repository Pattern, Models, Entity Manager Ivan Yonkov Technical Trainer Software University
2 Behind every great site, there is great data Eric Nelson Developer Evangelist Microsoft UK
Data Access Methodologies: When to choose what (ADO.NET, Entity Framework, WCF Data Services) Wriju Ghosh Lead Partner Consultant, Microsoft.
Microsoft Visual Basic 2015 CHAPTER ONE Introduction to Visual Basic 2015 Programming.
2 ADO.NET Data Services for the Web Mike Flasko Program Manager, Microsoft “Project Astoria”
DAT303 - Entity Framework: Application Patterns Pablo Castro Technical Lead, Microsoft Corporation.
Top 10 Entity Framework Features Every Developer Should Know
Introducing the Microsoft® .NET Framework
Introduction to Entity framework
Introduction to Entity Framework
Introduction to Windows Azure Cloud Services
LINQ for SQL SQL Saturday May 2009 David Fekke.
Introduction to Visual Basic 2008 Programming
Chris Menegay Sr. Consultant TECHSYS Business Solutions
Language Integrated Query: (LINQ) An introduction
Entity Framework By: Casey Griffin.
Learn. Imagine. Build. .NET Conf
Entity Framework 4 and WCF Data Services 4
ADO.NET Entity Framework
ADO.NEXT Advances in Data Access for 2008
An Introduction to Entity Framework
Language Integrated Query (LINQ)
Entity Framework Core (EF Core)
Tech Ed North America /1/ :36 AM Required Slide
Pablo Castro Software Architect Microsoft Corporation
Developing and testing enterprise Java applications
ADO.NET Entity Framework
Visual Studio 2010 and .NET Framework 4 Training Workshop
.NET Framework V3.5+ & RESTful web services
Writing Clean & efficient data access code with ADO
Presentation transcript:

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Microsoft Entity Framework v1.1 over Oracle Database Erez Harari Sela Technology Center

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Agenda Using data in applications Entity Framework WH questions Using EF –Designing a model –Querying a model –Working with the model –Data binding support What else is there Future of EF

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Storing application data Almost all application stores data Data is mostly stored in relation DBs –Data stored in tables –Related data is retrievable via views –Data is stored in a normalized manner –Business-Logic sometimes “leak” to the DB

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Modeling the data Applications support a more comprehensive model for data – Object Oriented Model –Class & Object (Entity type & instance) –Properties –Inheritance –Complex data-types

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Combining the two Mapping relational to OO can be sometimes problematic –Write code to load tables into classes –Write code to load Master-Detail relations –Write code to handle Create/Update/Delete (CUD) –Apply appropriate techniques to load & persist inheritance relations –Apply business logic to compute data after loading We had semi-solutions for some of these issues (Typed Datasets) We had 3 rd party solutions – O/R (Object- Relational) Mapping tools

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel What Is Entity Framework? An O/R Mapper The next layer in Ado.Net An entity model-driven architecture The first step in an entity-aware data platform

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Why Use Entity Framework? Why couple your data and your entities? Why write a DAL every time? Why learn different types of SQL syntaxes? Why work hard trying to handle inherited entities?

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Where can we find EF? Part of Visual Studio 2008 SP1 No special project type is required

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel How does EF work? DevArt tm dotConnect for Oracle DevArt tm dotConnect for Oracle

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel DEMO Just a taste

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel The Conceptual model Conceptual model is based on Entity Model Define entity types Group inherited types to an entity set Associate entities (1:1, 1:N, N:M)

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel The Storage model Defines different types of relational data sources: –Table –View –Stored Procedure –Native SQL Define functions for create / update / delete (CUD) –Use existing Stored-Procedures –Native SQL Import SP that retrieve Entities or Simple types

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Conceptual-Storage Mapping Map entity to storage (table, SP…) Allow filtering source data Support mapping single entity to multiple storage sources Map CUD functions to SP or SQL instead of auto-generated queries Support concurrency through original values Support result binding to query output

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel DEMO Building a model

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Querying EF - eSQL Brand new query language Allow un-typed references – no compilation check Can leverage inheritance and collections Useful for dynamic query building Employees model = new Employees(); var query = model.CreateQuery VALUE p From Employees.Person as p Where p.Age query.Parameters.Add(new ObjectParameter("age", 30)); foreach (Person p in query) { Console.WriteLine(p.FirstName + " " + p.LastName ); } Employees model = new Employees(); var query = model.CreateQuery VALUE p From Employees.Person as p Where p.Age query.Parameters.Add(new ObjectParameter("age", 30)); foreach (Person p in query) { Console.WriteLine(p.FirstName + " " + p.LastName ); }

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Querying EF – Extension Methods Query model against EDM Typed references, using lambda expressions Compiler verified Can return anonymous types A bit hard to read Employees model = new Employees(); int age = 30; var query = model.Person. Where(p => p.Age > age). Select(item => new { FullName = item.FirstName + " " + item.LastName }); foreach (var p in query) { Console.WriteLine(p.FullName); } Employees model = new Employees(); int age = 30; var query = model.Person. Where(p => p.Age > age). Select(item => new { FullName = item.FirstName + " " + item.LastName }); foreach (var p in query) { Console.WriteLine(p.FullName); }

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Querying EF – LINQ to Entities LINQ-based syntax Compiles as set of extension methods Much more readable than extension methods Makes building enhanced queries a lot easier Employees model = new Employees(); int age = 30; var query = from p in model.Person where p.Age > age select new { FullName = p.FirstName + " " + p.LastName}; foreach (var p in query) { Console.WriteLine(p.FullName); } Employees model = new Employees(); int age = 30; var query = from p in model.Person where p.Age > age select new { FullName = p.FirstName + " " + p.LastName}; foreach (var p in query) { Console.WriteLine(p.FullName); } 101 LINQ Samples LINQ Samples

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Querying - behind the scenes

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel DEMO Querying the model

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Transactions and Concurrency Transactions –All updates executed in.SaveChanges() are wrapped in a transaction –Fully integrated with System.Transactions –Supports explicitly transaction usage Concurrency –Uses Ado.Net Optimistic concurrency checks (off by default) –Using non-default update & delete queries (Native-SQL, SP…) allows access to current & original data

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Working with layers EF objects can be detached from & attached to a context EF objects support XML serialization –XmlSerializer –DataContractSerializer Can be consumed through different service types: –ASP.NET Web Services –WCF Services –Ado.Net Data Services (also support JSON serialization)

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Summary No more need to write DAL code Conceptual model satisfied using EDM CRUD operations support with no additional code needed Can be LINQed and queried in various ways Conceals, but doesn’t prevent – you can still use your DB code (SQL / SP) if required to

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Resources ADO.NET Entity Framework –Data platform developer center –Ado.Net team Blog –Forum &SiteID=1 &SiteID=1 ADO.NET Entity Framework V2 Design Contact Me –

© Copyright SELA Software & Education Labs Ltd Baruch Hirsch St. Bnei Brak Israel Linq2Sql VS Linq2EF LINQ to EntitiesLINQ to SQLFeature Y *YLanguage Integrated Database Queries YYEntity Inheritance YNSingle Entity From Multiple Tables YNMany-to-Many (No payload) YN (currently)Works with 3 rd party DBMS N (in V1.0)YSupports POCO (Plain Old CLR Objects) * Only queries than can be translated to SQL