linq in visual studio 2008

18
Language Integrated Query Mike Taulty Developer & Platform Group Microsoft Ltd [email protected] http://www.mtaulty.com

Upload: ukdpe

Post on 10-May-2015

4.391 views

Category:

Technology


2 download

DESCRIPTION

LINQ in Visual Studio 2008

TRANSCRIPT

Page 1: LINQ in Visual Studio 2008

Language Integrated Query

Mike TaultyDeveloper & Platform GroupMicrosoft [email protected] http://www.mtaulty.com

Page 2: LINQ in Visual Studio 2008

Why do we need LINQ?

My Code

“API”

SQL XML

Query As String Loosely typed result

Objects

Page 3: LINQ in Visual Studio 2008

Language Integrated Query

Page 4: LINQ in Visual Studio 2008

LINQ brings us closer to data

Page 5: LINQ in Visual Studio 2008

VB9

LINQ in the Languages

Many new language features in VB9 & C# 3

XML Literals

Relaxed Delegates

C# 3.0

Extension Methods

Object Initialisers

Anonymous Types

Implicit Typing

Lambdas

Collection Initialisers

Partial Methods

Automatic Properties

Page 6: LINQ in Visual Studio 2008

VB9

LINQ in the Languages

Some are enablers for LINQ

C# 3.0

Collection Initialisers

Partial Methods

Automatic Properties

Page 7: LINQ in Visual Studio 2008

LINQ Language Features

Page 8: LINQ in Visual Studio 2008

Query Pattern -> Language Features

Page 9: LINQ in Visual Studio 2008

Query Pattern -> Language Features

Compiler looks for extension methods which extend

IEnumerable<T> IQueryable<T>

Page 10: LINQ in Visual Studio 2008

IEnumerable<T> & IQueryable<T>

IEnumerable – query executed piece by piece

IQueryable – query executed in one go

whereselect

Capture & Execute

Execute Execute

where select

Page 11: LINQ in Visual Studio 2008

LINQ in VS2008 & Fx 3.5

Page 12: LINQ in Visual Studio 2008

LINQ to SQL, XML and DataSet

Page 13: LINQ in Visual Studio 2008

Beyond VS 2008 – ADO.NET V3.0

DataStore (SQL, Oracle, etc)

ADO.NET Provider (e.g. SqlClient, OracleClient, etc)

ADO.NET V2.0

ADO.NET Entity Provider (EntityClient)

Conceptual Data Model

Query with LINQ to Entities, Entity SQL

ADO.NET V3.0 & Entity Framework

Page 14: LINQ in Visual Studio 2008

LINQ to Entities

Page 15: LINQ in Visual Studio 2008

Summary

LINQ plumbed into VB9 and C#3.0 LanguagesLots of other language features too

LINQ enabled in .NET Framework V3.5Objects, SQL, XML, DataSet

LINQ enabled post .NET Framework V3.5Entities...

Page 16: LINQ in Visual Studio 2008

Resources

http://msdn.microsoft.com/vstudio MSDN LINQ Developer Centre

http://tinyurl.com/3e2qpo

ADO.NET Team Bloghttp://blogs.msdn.com/adonet

Page 17: LINQ in Visual Studio 2008

MSDN in the UK

Visit http://msdn.co.uk NewsletterEventsNugget VideosBlogs

Page 18: LINQ in Visual Studio 2008

© 2007 Microsoft Ltd. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the

date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.