Blue Theme Orange Theme Green Theme Red Theme
 
DevExpress Free UI Controls
Home | Forums | Videos | Photos | Downloads | Blogs | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
Safari Books Online
 Resources  
Close
 Our Network  
Close
Search :       Advanced Search »
Home » C# Language » Chapter 8: C# 4.0 Features

Chapter 8: C# 4.0 Features

This chapter looks at the new features added into C# 4.0 that combine to improve code readability and extend your ability to leverage LINQ to Object queries over dynamic data sources.

Technologies: C# Language
Author Name: Troy Magennis
Total downloads : 0
Total page views :  16254
Rating :
 4/5
This article has been rated :  1 times
  Add to Technorati Add to Technorati    Digg This Digg This    Add to del.icio.us Add to del.icio.us
    Rate this article Read/Post comments Support Us   Printable Version 

Chapter Contents
1. Evolution of C#
2. Optional and Named Arguments
3. Optional Arguments
4. Named Arguments
5. Using Named and Optional Arguments in LINQ Queries
6. Dynamic Typing
7. Using Dynamic Types in LINQ Queries
8. COM-Interop and LINQ
9. Adding a COM-Interop Reference
10. Building the Microsoft Excel Row Iterator
11. Summary

Become a Sponsor

C# is an evolving language. This chapter looks at the new features added into C# 4.0 that combine to improve code readability and extend your ability to leverage LINQ to Object queries over dynamic data sources. The examples in this chapter show how to improve the coding model for developers around reading data from various sources, including text files and how to combine data from a COM-Interop source into a LINQ to Objects query.

Evolution of C#

C# is still a relatively new language (circa 2000) and is benefiting from continuing investment by Microsoft's languages team. The C# language is an ECMA and ISO standard (ECMA is an acronym for European Computer Manufacturers Association, and although it changed its name to Ecma International in 1994, it kept the name Ecma for historical reasons1). The standard ECMA-334 and ISO/IEC 23270:2006 is freely available online at the Ecma International website2 and describes the language syntax and notation. However, Microsoft's additions to the language over several versions take some time to progress through the standards process, so Microsoft's release cycle lags.

Each version of C# has a number of new features and generally a major theme. The major themes have been generics and nullable types in C# 2.0, LINQ in C# 3.0, and dynamic types in C# 4.0. The major features added in each release are generally considered to be the following:

[lb] C# 2.0-Generics (framework support was added, and C# benefited from this); iterator pattern (the yield keyword); anonymous methods (the delegate keyword), nullable types, and the null coalescing operator (??).
[lb] C# 3.0-Anonymous types, extension methods, object initializers, collection initializers, implicitly typed local variables (var keyword), lambda expressions (=>), and the LINQ query expression pattern.
[lb] C# 4.0-Optional and Named Arguments, Dynamic typing (dynamic type), improved COM-Interop, and Contra and Co-Variance.

The new features in C# 3.0 that launched LINQ can be found in Chapter 2, "Introducing LINQ to Objects," and this chapter documents each of the major new features in C# 4.0 from the perspective of how they impact the LINQ story.

Total Pages : 11 12345


        Rate this article Read/Post comments Support Us   Printable Version
 Book Detail
Book Title : Essential C# 4.0
Author: Troy Magennis
Publisher: Addison Wesley
Price: 34.99 US$
EBook Price: 34.99 US$
Publisher Home Page: http://my.safaribooksonline.com
Book Url: http://my.safaribooksonline.com/9780321695635
 Post a new question or comment about this article
Subject:
Comment:
 [Top] Rate this article:-
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
Latest Comments:
Subject Posted By Posted On
Support Us
Tell your friends about us
Is this article is a Bad Submission report us here
Submit articles, tutorials, and tips
Help by answering questions on our discussion forums
Help us correct errors and broken links
Looking for a job? Post your resume here
Looking for developers? Post your job here


 Hosted by MaximumASP  |  Found a broken link?  |  Contact Us  |  Terms & conditions  |  Privacy Policy  |  Site Map  |  Suggest an Idea  |  Media Kit
Current Version: 5.2010.8.14
 © 2010  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.