Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ken Casada Developer Evangelist Microsoft Switzerland

Similar presentations


Presentation on theme: "Ken Casada Developer Evangelist Microsoft Switzerland"— Presentation transcript:

1 Ken Casada Developer Evangelist Microsoft Switzerland kcasada@microsoft.com http://blogs.msdn.com/swiss_dpe_team

2 Lap around C# 3.0 Enhancements (Demo) The LINQ Project LINQ flavor (Demo) LINQ to Object LINQ to DataSet LINQ to XML (LINQ to SQL)

3 Automatic properties Object Initializers Collection Initializers Extension Methods Anonymous Types Lambda Expressions Query Expression

4

5 Data != Objects

6 C# 3.0C# 3.0 Visual Basic 9.0Visual Basic 9.0.NET Language Integrated Query LINQ to Objects LINQ to DataSets LINQ to SQL LINQ to Entities LINQ to XML Objects XML Relational

7

8 DataSets fully integrated with LINQ Both typed and un-typed DataSets will work Do joins, grouping, etc over Data in DataTables Can create view that span multiple DataTables

9 Language integrated query for XML Designed to make XML usable without learning specialized technologies such as XPath/XSLT Construct and query XML data with fewer lines of code Builds on top the standard LINQ query commands Compose query expressions with multiple data stores Visual Basic 9 has additional XML capabilities XML literals – XML supported directly in language Property-like XML support– simple queries using conventional VB syntax

10 TodayXmlDocument doc = new XmlDocument(); XmlElement contacts = doc.CreateElement("contacts"); foreach (Customer c in customers) if (c.Country == "USA") { XmlElement e = doc.CreateElement("contact"); XmlElement name = doc.CreateElement("name"); name.InnerText = c.CompanyName; e.AppendChild(name); XmlElement phone = doc.CreateElement("phone"); phone.InnerText = c.Phone; e.AppendChild(phone); contacts.AppendChild(e); } doc.AppendChild(contacts); Great Food 555-7123 …

11 XElement contacts = new XElement("contacts", from c in customers where c.Country == "USA“ select new XElement("contact", new XElement("name", c.CompanyName), new XElement("phone", c.Phone) ) ); Great Food 555-7123 …

12 Provides object-to-relational mapping within the.NET Framework for Microsoft SQL Server databases Access relational data as strongly typed objects using LINQ query expressions Language integrated data access Tables and rows to classes and objects For Change Tracking Performance, … … have a look at the following session Real world LINQ to SQL: the Good, the Bad and the Ugly

13 Application SQL Server LINQ to SQL from c in db.Customers where c.City == "London" select c.CompanyName LINQ Query SQL Query SELECT CompanyName FROM Cust WHERE City = 'London' Rows ObjectsSubmitChanges() DML or Stored Procedures db.Customers.Add(c1); c2.City = “Seattle"; db.Customers.Remove(c3); INSERT INTO Customers… UPDATE Customers … DELETE FROM Customers …

14 MSDN Developer Center http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx LINQ Forum http://forums.microsoft.com/msdn/showforum.aspx?forumid=123 Channel9 Linq Videos http://channel9.msdn.com/tags/linq Blogs Scott Guthrie http://weblogs.asp.net/scottgu/archive/2007/04/21/new-orcas-language- feature-query-syntax.aspx Charlie Calvert http://blogs.msdn.com/charlie/archive/2006/10/05/Links-to-LINQ.aspx LINQ HOL C# 3.0 Enhancements & LINQC# 3.0 Enhancements & LINQ (English)

15 Questions?

16 © 2008 Microsoft Corporation. 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.


Download ppt "Ken Casada Developer Evangelist Microsoft Switzerland"

Similar presentations


Ads by Google