Presentation is loading. Please wait.

Presentation is loading. Please wait.

Michael Pizzo Software Architect Data Programmability Microsoft Corporation.

Similar presentations


Presentation on theme: "Michael Pizzo Software Architect Data Programmability Microsoft Corporation."— Presentation transcript:

1 Michael Pizzo Software Architect Data Programmability Microsoft Corporation

2 LINQ to Relational LINQ to SQL LINQ to Entities LINQ to DataSet Summary

3 Design Points Rapid Development against SQL Database Direct Mapping to SQL Server Schema Mappings expressed in Attributes or XML file "Just Work" for common scenarios Execute when needed Naming Conventions Business Logic Custom Insert/Update/Delete operations Minimally Intrusive object model Provide Customization, Optimizations where required Targets: Microsoft SQL Server RTM: Microsoft Visual Studio 2008 RTM

4 Direct Mapping Each class maps to a single SQL Schema Object Table, View Stored Procedure, Table Valued Function Simple renaming of Tables, Columns Foreign Keys can be expressed as Relationships Properties to navigate in query, results Inheritance Multiple Classes in a Hierarchy can map to a single Table/View/Stored Proc/TVF with a discriminator column

5 Customization Business Logic Partial classes for generated Objects Add Methods, non-persistent members, etc. Business Logic through Partial methods based on naming conventions Update Logic Implement partial methods in derived Class Call Stored Procedures or invoke custom logic Optimizations Loading Options "Span" related information ObjectTrackingEnabled DeferredLoadingEnabled Compiled Query Save overhead of SQL generation from Language Expression

6

7 Design Points Flexible Mapping to Existing Relational Schema Well defined Conceptual model Share common model across products (Reporting, Analysis, etc…) Declarative Mapping between Application and Store Allows Storage Schema and Application to evolve independently Explicit Operations Server interactions should be explicit Build implicit logic on top of explicit operations Common Textual "EntitySQL" Language for Ad-Hoc queries Targets: Microsoft SQL Server and third-party databases RTM: Microsoft Visual Studio 2008 Update H1CY08

8 Flexible Mapping Mapping a single class to multiple tables/views Mapping to different types of inheritance Single Table per Class Hierarchy Separate Table for each Class in a Hierarchy Shared Table for Base Class members in a Hierarchy Complex (composite) types i.e., Street, City, Region, and Zip as "Address" Directly mapping Many:Many relationships Mapping to an arbitrary Query Store Query Expose arbitrary store query as a storage Table Entity Query Express mapping as EntitySQL against storage schema

9 Customization Business Logic Partial Classes, Events, Partial Methods Update Logic Generated Update Views Declarative stored procedures Optimizations "Span" related members NoTracking Extensibility Partitioning of Metadata Flexible Runtime Mapping Metadata Pluggability

10

11 Disconnected Cache Offline/Remote Data Aggregation Application Data All with Change Tracking Queryable Filter, Projection Joins Across Tables Other in-Memory sources Local expressions All through Common LINQ syntax RTM: Microsoft Visual Studio 2008 RTM

12 Untyped DataSet Call AsEnumerable() on DataTable Reference Fields by Name Use Field (columnName) Project out fields for strongly typed result Typed DataSet Use strongly typed accessors var query = from row in myDataSet.Tables["Customers"].AsEnumerable() where row.Field ("City") == "London" select new { row.Field ("CustomerID"), row.Field ("ContactName") } ; var query = from customer in northwind.Customers where customer.City == "London" select customer;

13

14 LINQ to SQL – Strongly Typed Database Emphasis on rapid application development Direct mapping to Microsoft SQL Server family of databases Release in Microsoft Visual Studio 2008 RTM LINQ to Entities – Flexible mapping to existing Schema Focus on enterprise-grade data scenarios Flexible Mapping to Microsoft SQL Server and third-party databases Release in Microsoft Visual Studio 2008 update CTPs on top of Microsoft Visual Studio 2008 Betas/RTM LINQ to DataSet – In-Memory Cache w/Change Tracking All the scenarios where DataSet is useful today Offline, Disconnected, Aggregation Change Tracking..Plus support for Query Operations Strongly typed or Untyped DataSet Support Release in Microsoft Visual Studio 2008 RTM


Download ppt "Michael Pizzo Software Architect Data Programmability Microsoft Corporation."

Similar presentations


Ads by Google