1 / 19

Language Integrated Query

Language Integrated Query. Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com http://www.mtaulty.com. Agenda. Why do we want LINQ? How are query capabilities added to the languages? What is LINQ enabled in VS2008 & Fx 3.5? What is LINQ enabled after VS2008?.

Download Presentation

Language Integrated Query

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. Language Integrated Query Mike Taulty Developer & Platform Group Microsoft Ltd Mike.Taulty@microsoft.com http://www.mtaulty.com

  2. Agenda • Why do we want LINQ? • How are query capabilities added to the languages? • What is LINQ enabled in VS2008 & Fx 3.5? • What is LINQ enabled after VS2008?

  3. Why do we need LINQ? My Code Query As String Loosely typed result “API”  Objects SQL XML

  4. Language Syntax for Querying fromitemNameinsrcExpr joinitemNameinsrcExpronkeyExprequalskeyExpr (intoitemName)? letitemName= selExpr wherepredExpr orderby(keyExpr(ascending| descending)?)* selectselExpr groupselExprbykeyExpr intoitemName query-body

  5. LINQ brings us closer to data

  6. LINQ in the Languages • Many new language features in VB9 & C# 3 VB9 C# 3.0 XML Literals Anonymous Types Collection Initialisers Extension Methods Relaxed Delegates Lambdas Object Initialisers Implicit Typing Partial Methods

  7. LINQ in the Languages • Some are enablers for LINQ VB9 C# 3.0 XML Literals Anonymous Types Collection Initialisers Extension Methods Relaxed Delegates Lambdas Object Initialisers Implicit Typing Partial Methods

  8. LINQ Language Features

  9. Query Pattern -> Language Features

  10. Query Pattern -> Language Features • Compiler looks for extension methods which extend IEnumerable<T> IQueryable<T>

  11. IEnumerable<T> & IQueryable<T> • IEnumerable – query executed piece by piece • IQueryable – query executed in one go where select Execute Execute where select Capture & Execute

  12. LINQ in VS2008 & Fx 3.5

  13. LINQ to SQL, XML and DataSet

  14. Beyond VS 2008 – ADO.NET V3.0 ADO.NET V3.0 & Entity Framework Query with LINQ to Entities, Entity SQL ADO.NET Entity Provider (EntityClient) Conceptual Data Model Mapping ADO.NET V2.0 ADO.NET Provider (e.g. SqlClient, OracleClient, etc) DataStore (SQL, Oracle, etc)

  15. LINQ to Entities

  16. Summary • LINQ plumbed into VB9 and C#3.0 Languages • Lots of other language features too • LINQ enabled in .NET Framework V3.5 • Objects, SQL, XML, DataSet • LINQ enabled post .NET Framework V3.5 • Entities • ...

  17. Resources • http://msdn.microsoft.com/vstudio • MSDN LINQ Developer Centre • http://tinyurl.com/3e2qpo • ADO.NET Team Blog • http://blogs.msdn.com/adonet

  18. MSDN in the UK • Visit http://msdn.co.uk • Newsletter • Events • Nugget Videos • Blogs

More Related