The.NET Language Integrated Query Project Anders Hejlsberg TLN306 Technical Fellow Microsoft Corporation.

Slides:



Advertisements
Similar presentations
The Microsoft Technical Roadshow 2007 Language Enhancements and LINQ Daniel Moth Developer & Platform Group Microsoft Ltd
Advertisements

Language Integrated Query (LINQ) Martin Parry Developer & Platform Group Microsoft Ltd
Deep Dive into LINQ Eran Sharabi.NET Development Team Leader JohnBryce Training
Michael Pizzo Software Architect Data Programmability Microsoft Corporation.
© Logica All rights reserved ADO vNext LINQ LINQ to SQL Entity Framework Freek Leemhuis
DEV306 LINQ (Language Integrated Query)
Joshua Clark Consultant Sogeti USA Blog:
Live from Redmond: WebCast Conquering XML with Visual Basic 9 Amanda Silver Lead Program Manager Visual Basic Level: Starts Easy, Finishes Advanced.
Overview of Next-gen technologies Raimond Brookman IT Architect Info Support
ASP.NET 3.5 New Features. 2 Agenda What's New in.NET Framework 3.5? Visual Studio 2008 Enhancements LINQ (Language Integrated Query) New ASP.NET Server.
C# 3.0 & LINQ Raimond Brookman – IT Architect
LinqToSharePoint SandBoxed Solution Shakir Majeed Khan
Damien Guard (BSc, MBCS) Guernsey Software Developer Forum Language Integrated Query:
1 Agenda Data and System Trends ChallengesObservationsConclusion.
LINQ: Language-Integrated Queries (To be included in C # 3.0) Technology developed by Anders Hejlsberg & friends at Microsoft (2005) Presented by Tal Cohen.
Building a Complete Web Application Using ASP.NET 3.5 & Visual Studio 2008 (Part 1 of 2) Jeff King Program Manager Microsoft Corporation
C# 3.0 Tom Roeder CS fa. Version 3 From PDC 2005 preview compiler available LINQ: language-integrated query High level points: adds native query.
The Microsoft Technical Roadshow 2007 Advances for Data in VS “Orcas” Mike Taulty Developer & Platform Group Microsoft Ltd
C# 3.0 and LINQ Pavel Yosifovich CTO, Hi-Tech College
A tour of new features introducing LINQ. Agenda of LINQ Presentation We have features for every step of the way LINQ Fundamentals Anonymous Functions/Lambda.
Beth Massi Program Manager Visual Studio Community.
Paul Yuknewicz Lead Program Manager Microsoft Visual Basic DEV 319.
LINQ Programming in C# LINQ CSE Prof. Roger Crawfis.
 Introduction  What is LINQ  Syntax  How to Query  Example Program.
Slides from Gang Luo, Xuting Zhao and Damien Guard
Reflection IT LINQ & Entity Framework Fons Sonnemans (Trainer)
LINQ, An IntroLINQ, An Intro Florin−Tudor Cristea, Microsoft Student Partner.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics LINQ to XML: A Brief Overview Pavel Ježek.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics C# 3.0 and.NET 3.5: A Brief Overview Pavel Ježek.
Putting it all together: LINQ as an Example. The Problem: SQL in Code Programs often connect to database servers. Database servers only “speak” SQL. Programs.
Introduction to LINQ Lecture # 19 August Introduction How do you interrogate/manipulate data? What if you could do the work in a type-safe," string-free.
Лектор: Борислава Палева. Galin Iliev MCT, MCPD, MCSD.NET LINQ to XML.
Ronnie Saurenmann Principal Architect Microsoft Switzerland.
LINQ and C# 3.0 Mads Torgersen Program Manager for the C# Language Microsoft Corporation.
DAT 379 XML Today And Tomorrow Mark Fussell Lead Program Manager Microsoft Corporation.
LINQ: It’s Not Your Father’s Data Access Denny Boynton Anheuser-Busch Companies.
 Language Integrated Query  Make query a part of the language  Component of.NET Framework 3.5  Shipped with Visual Studio 2008.
LINQ Providers Or why.NET rules, and Java doesn’t Branimir Giurov SofiaDev.org UG Lead, C# MVP Freelance Software Developer
Välkommen till Sommarkollo VISUAL STUDIO 2008.
C# 2.0 and Future Directions Anders Hejlsberg Technical Fellow Microsoft Corporation.
C# 3.0 and LINQ Pavel Yosifovich CTO, Hi-Tech College
AUC Technologies LINQ (Language Integrated Query) LINQ Presented By : SHAIKH SHARYAR JAVED Software Engineer (Daedalus Software Inc.) Technology Teacher.
Language Integrated Query (LINQ). Data Access Programming Challenges Developers must learn data store-specific query syntax Multiple, disparate data stores.
By: Luis Carranco CIS764 - Fall  What is LINQ  Architecture  How does it work?  Samples/Demo  Why to use LINQ? 2.
C#: Future Directions in Language Innovation Anders Hejlsberg TLN307 Technical Fellow Microsoft Corporation.
Applied Linq Putting Linq to work Introducing… Class-A Kennisprovider Microsoft development Training Coaching Alex Thissen Trainer/coach.
LINQ & PLINQ (Parallel) Language Integrated Query.
Satisfy Your Technical Curiosity C# 3.0 Raj Pai Group Program Manager Microsoft Corporation
Linq Overview Vincent GERMAIN. Evolution - Rappel Langage  C# 2.0  C# 3.0 (Local type inference, Lambda expression, Method extension,Anonymous type)
Damien Guard (BSc, MBCS) Guernsey Software Developer Forum Language Integrated Query:
Joel Pobar Language Geek Microsoft DEV320 Improve on C# % Backwards Compatible Language Integrated Query (LINQ)
Ken Casada Developer Evangelist Microsoft Switzerland
Language Integrated Query Mike Taulty Developer & Platform Group Microsoft Ltd
Part 1: Overview of LINQ Intro to LINQ Presenter: PhuongNQK.
Introduction to Entity Framework
Jim Fawcett CSE681 – Software Modeling and Analysis Fall 2016
Jim Fawcett CSE681 – Software Modeling and Analysis Fall 2013
Intro to LINQ Part 2 – Concepts and LINQ to Objects
Language Integrated Query: (LINQ) An introduction
Avalon – Using Data In Your Applications
9/20/2018 2:13 PM Visual Studio развитие технологий доступа к данным на платформе Microsoft.NET Роман Здебский Эксперт по технологиям разработки.
Language Integrated Query (LINQ)
Visual Studio “Orcas” & .NET Framework v3.5
Language Integrated Query (LINQ)
INFO 344 Web Tools And Development
Технологии доступа к данным на платформе Microsoft.NET
04 | Data Acess Technologies
ADO.NET Entity Framework
LINQ - 2 Ravi Kumar C++/C# Team.
CS4540 Special Topics in Web Development LINQ to Objects
Presentation transcript:

The.NET Language Integrated Query Project Anders Hejlsberg TLN306 Technical Fellow Microsoft Corporation

Problem: Data != Objects

The LINQ Project Standard Query Operators Objects DLinq (ADO.NET) XLinq(System.Xml) XML.NET Language Integrated Query C#VBOthers… SQLWinFS

The LINQ Project

Language Innovations Lambda expressions Extension methods Local variable type inference Object initializers Anonymous types Query expressions Expression trees var x = 5; static void Dump(this object o); c => c.Name new Point { x = 1, y = 2 } new { c.Name, c.Phone } from … where … select Expression<T>

Standard Query Operators RestrictionWhere Projection Select, SelectMany Ordering OrderBy, ThenBy GroupingGroupBy Quantifiers Any, All Partitioning Take, Skip, TakeWhile, SkipWhile Sets Distinct, Union, Intersect, Except Elements First, FirstOrDefault, ElementAt Aggregation Count, Sum, Min, Max, Average Conversion ToArray, ToList, ToDictionary CastingOfType<T>

Deferred Query Execution Customer[] custs = SampleData.GetCustomers(); custsPhoneNameID var query = from c in custs where c.City == "London" select c.Name; var query = custs.Where(c => c.City == "London").Select(c => c.Name); Select c => c.Name string[] names = query.ToArray(); names c => c.City == "London" Where

DLinq For Relational Data SqlConnection c = new SqlConnection(…); c.Open(); SqlCommand cmd = new c.Name, c.Name, c.Phone FROM Customers c FROM Customers c WHERE c.City WHERE c.City "London“); DataReader dr = c.Execute(cmd); while (dr.Read()) { string name = dr.GetString(0); string name = dr.GetString(0); string phone = dr.GetString(1); string phone = dr.GetString(1); DateTime date = dr.GetDateTime(2); DateTime date = dr.GetDateTime(2);}dr.Close(); Accessing data today Queries in quotes Loosely bound arguments Loosely typed result sets No compile time checks

public class Customer { … } public class Northwind: DataContext { public Table Customers; public Table Customers; …} Northwind db = new Northwind(…); var contacts = from c in db.Customers from c in db.Customers where c.City == "London" where c.City == "London" select new { c.Name, c.Phone }; select new { c.Name, c.Phone }; DLinq For Relational Data Accessing data with DLinq Classes describe data Strongly typed connection Integrated query syntax Strongly typed results Tables are like collections

DLinq For Relational Data Language integrated data access Maps tables and rows to classes and objects Builds on ADO.NET and.NET Transactions Mapping Encoded in attributes Relationships map to properties Persistence Automatic change tracking Updates through SQL or stored procedures

XLinq For XML Data XmlDocument doc = new XmlDocument(); XmlElement contacts = doc.CreateElement("contacts"); foreach (Customer c in customers) if (c.Country == "USA") { if (c.Country == "USA") { XmlElement e = doc.CreateElement("contact"); XmlElement e = doc.CreateElement("contact"); XmlElement name = doc.CreateElement("name"); XmlElement name = doc.CreateElement("name"); name.InnerText = c.CompanyName; name.InnerText = c.CompanyName; e.AppendChild(name); e.AppendChild(name); XmlElement phone = doc.CreateElement("phone"); XmlElement phone = doc.CreateElement("phone"); phone.InnerText = c.Phone; phone.InnerText = c.Phone; e.AppendChild(phone); e.AppendChild(phone); contacts.AppendChild(e); contacts.AppendChild(e); }doc.AppendChild(contacts); Programming XML today <contacts> Great Lakes Food Great Lakes Food (503) (503) …</contacts> Imperative model Document centric No integrated queries Memory intensive

XLinq For XML Data XElement contacts = new XElement("contacts", from c in customers from c in customers where c.Country == "USA" where c.Country == "USA" select new XElement("contact", select new XElement("contact", new XElement("name", c.CompanyName), new XElement("name", c.CompanyName), new XElement("phone", c.Phone) new XElement("phone", c.Phone) )); Programming XML with XLinq Declarative model Element centric Integrated queries Smaller and faster

XLinq For XML Data Language integrated query for XML Expressive power of XPath / XQuery But with C# or VB as programming language Leverages experience with DOM Element centric, not document centric Functional construction Text nodes are just strings Simplified XML namespace support Faster and smaller

DLinq and XLinq

The LINQ Project Language Integrated Query for.NET Native query syntax in C# 3.0 and VB 9.0 Standard Query Operators SQL-like queries for any.NET collection DLinq Query enabled data access framework XLinq Query enabled, smaller, faster XML DOM

Benefits Of LINQ Unified querying of objects, relational, XML Type checking and IntelliSense for queries SQL and XQuery-like power in C# and VB Extensibility model for languages / APIs

More Information WednesdayThursdayFriday TLN306 - LINQ Overview 1:45 PM - 3:00 PM Halls C & D TLN308 - VB :00 AM - 11:15 AM Room 411 DAT323 (R) - DLinq for SQL 8:30 AM - 9:45 AM Room 408 AB TLN307 - C# 3.0 3:15 PM - 4:30 PM Halls C & D TLN307 (R) - C# 3.0 2:15 PM - 3:30 PM Room 402 AB DAT324 (R) - XLinq 10:30 AM -11:45 AM Room 408 AB DAT312 - DLinq for WinFS 5:00 PM – 6:15 PM Room 515 AB DAT323 - DLinq for SQL 2:15 PM - 3:30 PM Room 152/153 (Hall F) PNL11 - LINQ Panel 1:00 PM - 2:30 PM Room 152/153 (Hall F) DAT324 - XLinq 5:15 PM – 6:30 PM Room 404 Ask the Experts 6:30 PM – 9:00 PM Main Hall

© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.