0% found this document useful (0 votes)
23 views

C# Features

This document discusses new features in C# 4.0 and how they improve code readability and enable LINQ queries over dynamic data sources. It provides context on the evolution of C# and highlights major new features introduced in versions 2.0, 3.0, and 4.0. These include generics, LINQ support, dynamic typing, optional parameters, and improved COM interoperability. The chapter aims to demonstrate how the C# 4.0 features enhance working with LINQ to Objects queries.

Uploaded by

cnu0305
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

C# Features

This document discusses new features in C# 4.0 and how they improve code readability and enable LINQ queries over dynamic data sources. It provides context on the evolution of C# and highlights major new features introduced in versions 2.0, 3.0, and 4.0. These include generics, LINQ support, dynamic typing, optional parameters, and improved COM interoperability. The chapter aims to demonstrate how the C# 4.0 features enhance working with LINQ to Objects queries.

Uploaded by

cnu0305
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

■ Define new C# 4.0 language features.

■ Demonstrate the new language features in the context of LINQ to Objects.


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 reasons. 1) 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 leads Ecma’s acceptance by at least a version.
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:
■ C# 2.0—Generics (.NET 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 (??).
■ 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.
■ C# 4.0—Optional Parameters and Named Arguments, Dynamic
typing (dynamic type), improved COM-Interop, and Contra and
Co-Variance.
The new features in C# 3.0 that launched language support for 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.

You might also like