140 likes | 324 Views
ADO.NET Data Services and the ADO.NET Entity Framework. A tour of new features found in the ADO.NET Entity Framework. Personal Information (a little about me). Nathan Zaugg I have been using .net since 2001 I currently work for SolutionStream as an Applications Architect / Consultant
E N D
ADO.NET Data Services and the ADO.NET Entity Framework A tour of new features found in the ADO.NET Entity Framework.
Personal Information (a little about me) Nathan Zaugg I have been using .net since 2001 I currently work for SolutionStream as an Applications Architect / Consultant I have a BS degree in CS from WSU, and have my MCAD certification I love new technology! Contact Information: nzaugg@gmail.com http://InteractiveASP.NET
Overview of the Entity Framework • Released in Visual Studio 2008 SP1 • Requires .NET Framework 3.5 SP1 (Included in VS 2008 SP1) • Three main components • Entity Client • Object Services • LINQ to Entities
Why use Entity Framework? • Compatible with any ADO.NET Client • Allow for modeling a different conceptual model than the physical model • Allows for Complex Properties and Object Inheritance in the conceptual model • Easy to use in place of ADO.NET • Easy to implement Dynamic Queries while preserving Type Safety
ADO.NET Entity Vocabulary • SSDL – Server Schema Definition Language • MSL – Mapping Specification Language (C-S Map) • CSDL – Conceptual Schema Definition Language • EDM – Entity Data Model (Object Space) • Entity Client – ADO.NET Style Data Access Provider • Object Services – A set of abstraction on top of the Entity Client that provides a strongly typed access to the data • Entity SQL – A special SQL syntax for making text queries against the EDM
Example 1 :: Building our first EDM & the Entity Client • Create a new Entity • Mapping 1:1 is done automatically from any ADO.NET Client • The Entity Client works just like current ADO.NET objects • Relationships can be given meaningful names • Query Syntax Differences • View the SSDL, MSL, and CSDL • Advanced Types & Inheritance • Add / Remove Entities
Example 2 :: Object Services & Entity SQL • Dynamically Query Object Services using Entity SQL • Lazy Loading vs. Eager Loading • Insert / Update / Delete using Object Services
Example 3 :: LINQ to Entities • Query a EDM using LINQ • Insert, Update, and Delete Objects • Use Type Inference & Eager Loading to get related table data • Lazy Loading with LINQ • Detaching & Reattaching an object
Summary • Use the EDM Designer • Become familiar with the EntityClient and Entity SQL • Used Object Services with Entity SQL to return strongly typed objects • LINQ to Entity