xxi
■ Contents
The IntelliSense of Extension Methods ............................................................................................... 422
Extending Types Implementing Specific Interfaces ............................................................................ 422
Understanding Anonymous Types ................................................................................ 424
Defining an Anonymous Type .............................................................................................................. 424
The Internal Representation of Anonymous Types .............................................................................. 425
The Implementation of ToString( ) and GetHashCode( ) ....................................................................... 427
The Semantics of Equality for Anonymous Types ............................................................................... 427
Anonymous Types Containing Anonymous Types ............................................................................... 429
Working with Pointer Types .......................................................................................... 429
The unsafe Keyword ........................................................................................................................... 431
Working with the * and & Operators ................................................................................................... 433
An Unsafe (and Safe) Swap Function .................................................................................................434
Field Access via Pointers (the -> Operator) ........................................................................................ 435
The stackalloc Keyword ......................................................................................................................435
Pinning a Type via the fixed Keyword ................................................................................................. 436
The sizeof Keyword ............................................................................................................................437
Summary ...................................................................................................................... 437
■Chapter 12: LINQ to Objects ������������������������������������������������������������������������������� 439
LINQ-Specific Programming Constructs ....................................................................... 439
Implicit Typing of Local Variables ....................................................................................................... 440
Object and Collection Initialization Syntax.......................................................................................... 440
Lambda Expressions ...........................................................................................................................441
Extension Methods ............................................................................................................................. 442
Anonymous Types ............................................................................................................................... 443
Understanding the Role of LINQ ................................................................................... 443
LINQ Expressions Are Strongly Typed ................................................................................................. 444
The Core LINQ Assemblies .................................................................................................................. 444
Applying LINQ Queries to Primitive Arrays ................................................................... 445
Once Again, Without LINQ ................................................................................................................... 447
Reflecting over a LINQ Result Set .......................................................................................................447