1 / 30

Advances for Data in VS “Orcas”

Advances for Data in VS “Orcas”. Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com http://www.mtaulty.com. Earlier that day. Object. Object. Object. Object. from itemName in srcExpr join itemName in srcExpr on keyExpr equals keyExpr ( into itemName ) ?

ivan
Download Presentation

Advances for Data in VS “Orcas”

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Advances for Data in VS “Orcas” Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com http://www.mtaulty.com

  2. Earlier that day.... Object Object Object Object fromitemNameinsrcExpr join itemNameinsrcExpronkeyExprequalskeyExpr (intoitemName)? letitemName= selExpr wherepredExpr orderby(keyExpr(ascending| descending)?)* selectselExpr group selExprbykeyExpr intoitemName query-body

  3. IEnumerable<T>? Object fromitemNameinsrcExpr wherepredExpr orderby(keyExpr(ascending| descending)?)* selectselExpr ... Object Object Object Object Object where Object Object orderby Object select

  4. IQueryable<T>? Object fromitemNameinsrcExpr wherepredExpr orderby(keyExpr(ascending| descending)?)* selectselExpr ... Object Object Object where where where orderby orderby Object Object Object Object Object select

  5. IEnumerablevsIQueryable

  6. Agenda”Would you like LINQ with that?” 1 2 3

  7. LINQ over XML 1 LINQ Pattern fromitemNameinsrcExpr join itemNameinsrcExpronkeyExprequalskeyExpr (intoitemName)? letitemName= selExpr wherepredExpr orderby(keyExpr(ascending| descending)?)* selectselExpr group selExprbykeyExpr intoitemName query-body New XML API

  8. System.Xml.XLinq • New XML API (more DOM than reader) • Key classes: XElement, XAttribute

  9. LINQ over XML

  10. LINQ to SQL 2 LINQ Pattern fromitemNameinsrcExpr join itemNameinsrcExpronkeyExprequalskeyExpr (intoitemName)? letitemName= selExpr wherepredExpr orderby(keyExpr(ascending| descending)?)* selectselExpr group selExprbykeyExpr intoitemName query-body Object Relational Mapping API Code Gen Tools

  11. System.Data.Dlinq – Data API

  12. DataContext, Table & Friends

  13. But what about? • Identity • Relationships • Insert, Update, Delete • Constraints • Generated columns • Transactions • Stored Procedures, Views, Functions • Deferred Loading • Inheritance • Concurrency • Modifications without query • e.g. N-Tier updates

  14. More detail but no updates yet...

  15. Identity Management My Process Query Id=58 Update Id=58, Colour=Blue Query Id=58 Identity Management Object Id=58, Colour = Red Object Id=58, Colour = Blue Original Current SQL Row ID = 58, Colour=Red

  16. Change Tracking (1) My Process DataContext.SubmitChanges() Change Tracking Object Id=58, Colour = Red Object Id=58, Colour = Blue Original Current Compare & Generate SQL SQL

  17. Change Tracking (2) My Process Update Id=58, Colour=Blue Fire Property Changed Notification! Change Tracking Object Id=58, Colour = Red Object Id=58, Colour = Blue Original Current SQL

  18. Change Tracking (3) My Process DataContext.SubmitChanges() Change Tracking Object Id=58, Colour = Blue Current Generate SQL from List of Changes SQL

  19. Updates, Transactions...

  20. LINQ to DataSet 3 LINQ Pattern fromitemNameinsrcExpr join itemNameinsrcExpronkeyExprequalskeyExpr (intoitemName)? letitemName= selExpr wherepredExpr orderby(keyExpr(ascending| descending)?)* selectselExpr group selExprbykeyExpr intoitemName query-body Jo John Jim FirstName Fred Blogs LastName Doe Smith Jones 22 43 55 Age 17 1.3 1.2 1.4 Height 1.5 DataSet/DataTable

  21. Linq to DataSet • Existing DataTable already has some query capabilities • LINQ syntax extends to DataSet to apply the same model for querying

  22. LINQ to DataSet

  23. Putting a few things together

  24. Awareness: ADO.NET Entity Framework

  25. Conceptual Models Conceptual Design (Entities & Relationships) Customer Order Application (Entities & Relationships) places SalesPerson sells

  26. Relational Models relational schema (normalised, tables, keys) Application (Entities & Relationships) SP's SP's SP's Mapping Logic Conceptual<->Relational Mapping Logic Conceptual<->Relational Mapping Logic Conceptual<->Relational Views Views Views Fn's Fn's Fn's Application (Entities & Relationships) Application (Entities & Relationships)

  27. ADO.NET Entity Framework Application (Entities & Relationships) LINQ Syntax Entity SQL Conceptual Schema (XML) Store Schema (XML) ADO.NET Mapping Provider Mapping Schema (XML) Object Services (Inheritance & Complex Types) SQL ADO.NET Database Provider (e.g. SqlProvider)

  28. Do Try This At Home But... • This Talk Was Brought To You By; • The LINQ May CTP • The ADO.NET V.Next August CTP • Concepts have not changed • Later CTPs have slightly altered syntax • My CTP lacked IntelliSense • In the later builds

  29. Summary • Powerful, intuitive LINQ pattern • One "syntax" to learn • Relational, hierarchical, object data • Underpinned by new or existing API's • For Relational Data • LINQ to SQL • ORM over database schema • LINQ to Entities and the Entity Framework • ORM over conceptual model

  30. roadshowresources.com

More Related