Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language...
-
Upload
lorena-jacobs -
Category
Documents
-
view
223 -
download
0
description
Transcript of Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language...
![Page 1: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/1.jpg)
![Page 2: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/2.jpg)
Microsoft Visual C# Under the Covers: In-Depth C# 3.0Joel PobarLanguage GeekMicrosoft
DEV320
![Page 3: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/3.jpg)
C# 3.0 Design Themes
Improve on C#2.0
100% Backwards Compatible
Language Integrated Query (LINQ)
![Page 4: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/4.jpg)
C# 3.0 Features
demo
![Page 5: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/5.jpg)
Data != Objects
![Page 6: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/6.jpg)
The LINQ ProjectC# 3.0 VB 9.0 Others
.NET Language Integrated Query
LINQ toObjects
LINQ toDataSet
sLINQ to
SQLLINQ toEntities
LINQ toXML
Objects
<book> <title/> <author/> <year/> <price/></book>
XML
Relational
![Page 7: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/7.jpg)
Building LINQ
demo
![Page 8: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/8.jpg)
Query ExpressionsProject Select <expr>, Return <expr>Filter Where <expr>, DistinctTest Any(<expr>), All(<expr>)Join <expr> Join <expr> On <expr> = <expr>Group Group By <expr>, <expr> Aggregate <expr>,
<expr>Group Join <decl> On <expr> = <expr> Aggregate <expr>
Aggregate
Count(<expr>), Sum(<expr>), Min(<expr>), Max(<expr>), Avg(<expr>), Group(<expr>)…
Partition Skip [ While ] <expr>, Take [ While ] <expr>Set Union, Intersect, ExceptOrder Order By <expr>, <expr>
![Page 9: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/9.jpg)
C# 3.0 – New FeaturesLocal Variable Type InferenceObject Initializers
Collection InitializersAnonymous Types
Auto-Implemented PropertiesExtension MethodsLambdasQuery ExpressionsExpression TreesPartial MethodsImplicitly-Typed Arrays
![Page 10: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/10.jpg)
Summary
Motivation
Language Integrated Query
C# 3.0 New Language Features
![Page 11: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/11.jpg)
ResourcesTechnical Communities, Webcasts, Blogs, Chats & User Groupshttp://www.microsoft.com/communities/default.mspx
Microsoft Developer Network (MSDN) & TechNet http://microsoft.com/msdn http://microsoft.com/technet
Trial Software and Virtual Labshttp://www.microsoft.com/technet/downloads/trials/default.mspx
Microsoft Learning and Certificationhttp://www.microsoft.com/learning/default.mspx
Visual C# Developer Centerhttp://msdn2.microsoft.com/en-us/vcsharp/default.aspx
Visual Studio 2008 Beta1 Download Pagehttp://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx
Visual Studio 2008 Sampleshttp://msdn2.microsoft.com/en-us/bb330936.aspx
![Page 12: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/12.jpg)
Evaluation Forms
![Page 13: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/13.jpg)
Questions?
![Page 14: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/14.jpg)
© 2007 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.
![Page 15: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/15.jpg)
Expression Tree'sBinaryExpressionConstantExpressionFuncletExpressionInvocationExpressionLambdaExpressionMemberExpressionMethodCallExpressionNAryExpressionNewArrayExpressionNewExpressionParameterExpressionTernaryExpressionTypeBinaryExpressionUnaryExpression
![Page 16: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/16.jpg)
Expression Tree’s
Expression: “a + b”
ParameterExpression a = Expression.Parameter(typeof(int), "a");
ParameterExpression b = Expression.Parameter(typeof(int), "b");
BinaryExpression add = Expression.Add(a, b);Expression<Func<int,int,int>> l =
Expression.Lambda<Func<int,int,int>>(add, a, b);
Console.WriteLine(DoBinOp(l, 1, 2));
![Page 17: Joel Pobar Language Geek Microsoft DEV320 Improve on C#2.0 100% Backwards Compatible Language Integrated Query (LINQ)](https://reader035.fdocuments.us/reader035/viewer/2022062413/5a4d1b487f8b9ab0599a4313/html5/thumbnails/17.jpg)
Expression Tree's
Param“a”
Param“b”
Binary“Add”