C# 6.0 and the .NET 4.6 Framework, Seventh Edition

Book description

This new 7th edition of Pro C# 6.0 and the .NET 4.6 Platform has been completely revised and rewritten to reflect the latest changes to the C# language specification and new advances in the .NET Framework. You'll find new chapters covering all the important new features that make .NET 4.6 the most comprehensive release yet, including:

  • A Refined ADO.NET Entity Framework Programming Model
  • Numerous IDE and MVVM Enhancements for WPF Desktop Development
  • Numerous updates to the ASP.NET Web APIs
  • This comes on top of award winning coverage of core C# features, both old and new, that have made the previous editions of this book so popular. Readers will gain a solid foundation of object-oriented development techniques, attributes and reflection, generics and collections as well as numerous advanced topics not found in other texts (such as CIL opcodes and emitting dynamic assemblies).

    The mission of this book is to provide you with a comprehensive foundation in the C# programming language and the core aspects of the .NET platform plus overviews of technologies built on top of C# and .NET (ADO.NET and Entity Framework, Windows Communication Foundation [WCF], Windows Presentation Foundation [WPF], and ASP.NET [WebForms, MVC, WebAPI]). Once you digest the information presented in these chapters, you’ll be in a perfect position to apply this knowledge to your specific programming assignments, and you’ll be well equipped to explore the .NET universe on your own terms.

    Table of contents

    1. Cover
    2. Title
    3. Copyright
    4. Dedication
    5. Contents at a Glance
    6. Contents
    7. About the Authors
    8. About the Technical Reviewer
    9. Acknowledgments
    10. Introduction
    11. Part I: Introducing C# and the .NET Platform
      1. Chapter 1: The Philosophy of .NET
        1. An Initial Look at the .NET Platform
          1. Some Key Benefits of the .NET Platform
        2. Introducing the Building Blocks of the .NET Platform (the CLR, CTS, and CLS)
          1. The Role of the Base Class Libraries
          2. What C# Brings to the Table
          3. Managed vs. Unmanaged Code
        3. Additional .NET-Aware Programming Languages
          1. Life in a Multilanguage World
        4. An Overview of .NET Assemblies
          1. The Role of the Common Intermediate Language
          2. Benefits of CIL
          3. Compiling CIL to Platform-Specific Instructions
          4. The Role of .NET Type Metadata
          5. The Role of the Assembly Manifest
        5. Understanding the Common Type System
          1. CTS Class Types
          2. CTS Interface Types
          3. CTS Structure Types
          4. CTS Enumeration Types
          5. CTS Delegate Types
          6. CTS Type Members
          7. Intrinsic CTS Data Types
        6. Understanding the Common Language Specification
          1. Ensuring CLS Compliance
        7. Understanding the Common Language Runtime
        8. The Assembly/Namespace/Type Distinction
          1. The Role of the Microsoft Root Namespace
          2. Accessing a Namespace Programmatically
          3. Referencing External Assemblies
        9. Exploring an Assembly Using ildasm.exe
          1. Viewing CIL Code
          2. Viewing Type Metadata
          3. Viewing Assembly Metadata (aka the Manifest)
        10. The Platform-Independent Nature of .NET
          1. The Mono Project
          2. Microsoft .NET Core
        11. Summary
      2. Chapter 2: Building C# Applications
        1. Building C# Applications on the Windows OS
          1. The Visual Studio Express Family of IDEs
          2. The Visual Studio Community Edition IDE
          3. The Visual Studio 2015 Professional IDE
          4. The .NET Framework Documentation System
        2. Building .NET Applications Beyond the Windows OS
          1. The Role of Xamarin Studio
        3. Summary
    12. Part II: Core C# Programming
      1. Chapter 3: Core C# Programming Constructs, Part I
        1. The Anatomy of a Simple C# Program
          1. Variations on the Main( ) Method
          2. Specifying an Application Error Code
          3. Processing Command-Line Arguments
          4. Specifying Command-Line Arguments with Visual Studio
        2. An Interesting Aside: Some Additional Members of the System.Environment Class
        3. The System.Console Class
          1. Basic Input and Output with the Console Class
          2. Formatting Console Output
          3. Formatting Numerical Data
          4. Formatting Numerical Data Beyond Console Applications
        4. System Data Types and Corresponding C# Keywords
          1. Variable Declaration and Initialization
          2. Intrinsic Data Types and the new Operator
          3. The Data Type Class Hierarchy
          4. Members of Numerical Data Types
          5. Members of System.Boolean
          6. Members of System.Char
          7. Parsing Values from String Data
          8. System.DateTime and System.TimeSpan
          9. The System.Numerics.dll Assembly
        5. Working with String Data
          1. Basic String Manipulation
          2. String Concatenation
          3. Escape Characters
          4. Defining Verbatim Strings
          5. Strings and Equality
          6. Strings Are Immutable
          7. The System.Text.StringBuilder Type
          8. String Interpolation
        6. Narrowing and Widening Data Type Conversions
          1. The checked Keyword
          2. Setting Project-wide Overflow Checking
          3. The unchecked Keyword
        7. Understanding Implicitly Typed Local Variables
          1. Restrictions on Implicitly Typed Variables
          2. Implicit Typed Data Is Strongly Typed Data
          3. Usefulness of Implicitly Typed Local Variables
        8. C# Iteration Constructs
          1. The for Loop
          2. The foreach Loop
          3. Use of Implicit Typing Within foreach Constructs
          4. The while and do/while Looping Constructs
        9. Decision Constructs and the Relational/Equality Operators
          1. The if/else Statement
          2. Equality and Relational Operators
          3. Conditional Operators
          4. The switch Statement
        10. Summary
      2. Chapter 4: Core C# Programming Constructs, Part II
        1. Methods and Parameter Modifiers
          1. The Default by Value Parameter-Passing Behavior
          2. The out Modifier
          3. The ref Modifier
          4. The params Modifier
          5. Defining Optional Parameters
          6. Invoking Methods Using Named Parameters
          7. Understanding Method Overloading
        2. Understanding C# Arrays
          1. C# Array Initialization Syntax
          2. Implicitly Typed Local Arrays
          3. Defining an Array of Objects
          4. Working with Multidimensional Arrays
          5. Arrays As Arguments or Return Values
          6. The System.Array Base Class
        3. Understanding the enum Type
          1. Controlling the Underlying Storage for an enum
          2. Declaring enum Variables
          3. The System.Enum Type
          4. Dynamically Discovering an enum’s Name/Value Pairs
        4. Understanding the Structure (aka Value Type)
          1. Creating Structure Variables
        5. Understanding Value Types and Reference Types
          1. Value Types, References Types, and the Assignment Operator
          2. Value Types Containing Reference Types
          3. Passing Reference Types by Value
          4. Passing Reference Types by Reference
          5. Final Details Regarding Value Types and Reference Types
        6. Understanding C# Nullable Types
          1. Working with Nullable Types
          2. The Null Coalescing Operator
          3. The Null Conditional Operator
        7. Summary
    13. Part III: Object-Oriented Programming with C#
      1. Chapter 5: Understanding Encapsulation
        1. Introducing the C# Class Type
          1. Allocating Objects with the new Keyword
        2. Understanding Constructors
          1. The Role of the Default Constructor
          2. Defining Custom Constructors
          3. The Default Constructor Revisited
        3. The Role of the this Keyword
          1. Chaining Constructor Calls Using this
          2. Observing Constructor Flow
          3. Revisiting Optional Arguments
        4. Understanding the static Keyword
          1. Defining Static Field Data
          2. Defining Static Methods
          3. Defining Static Constructors
          4. Defining Static Classes
          5. Importing Static Members via the C# using Keyword
        5. Defining the Pillars of OOP
          1. The Role of Encapsulation
          2. The Role of Inheritance
          3. The Role of Polymorphism
        6. C# Access Modifiers
          1. The Default Access Modifiers
          2. Access Modifiers and Nested Types
        7. The First Pillar: C#’s Encapsulation Services
          1. Encapsulation Using Traditional Accessors and Mutators
          2. Encapsulation Using .NET Properties
          3. Using Properties Within a Class Definition
          4. Read-Only and Write-Only Properties
          5. Revisiting the static Keyword: Defining Static Properties
        8. Understanding Automatic Properties
          1. Interacting with Automatic Properties
          2. Automatic Properties and Default Values
          3. Initialization of Automatic Properties
        9. Understanding Object Initialization Syntax
          1. Calling Custom Constructors with Initialization Syntax
          2. Initializing Data with Initialization Syntax
        10. Working with Constant Field Data
          1. Understanding Read-Only Fields
          2. Static Read-Only Fields
        11. Understanding Partial Classes
          1. Use Cases for Partial Classes?
        12. Summary
      2. Chapter 6: Understanding Inheritance and Polymorphism
        1. The Basic Mechanics of Inheritance
          1. Specifying the Parent Class of an Existing Class
          2. Regarding Multiple Base Classes
          3. The sealed Keyword
        2. Revising Visual Studio Class Diagrams
        3. The Second Pillar of OOP: The Details of Inheritance
          1. Controlling Base Class Creation with the base Keyword
          2. Keeping Family Secrets: The protected Keyword
          3. Adding a Sealed Class
        4. Programming for Containment/Delegation
          1. Understanding Nested Type Definitions
        5. The Third Pillar of OOP: C#’s Polymorphic Support
          1. The virtual and override Keywords
          2. Overriding Virtual Members Using the Visual Studio IDE
          3. Sealing Virtual Members
          4. Understanding Abstract Classes
          5. Understanding the Polymorphic Interface
          6. Understanding Member Shadowing
        6. Understanding Base Class/Derived Class Casting Rules
          1. The C# as Keyword
          2. The C# is Keyword
        7. The Master Parent Class: System.Object
          1. Overriding System.Object.ToString()
          2. Overriding System.Object.Equals()
          3. Overriding System.Object.GetHashCode()
          4. Testing Your Modified Person Class
          5. The Static Members of System.Object
        8. Summary
      3. Chapter 7: Understanding Structured Exception Handling
        1. Ode to Errors, Bugs, and Exceptions
        2. The Role of .NET Exception Handling
          1. The Building Blocks of .NET Exception Handling
          2. The System.Exception Base Class
        3. The Simplest Possible Example
          1. Throwing a General Exception
          2. Catching Exceptions
        4. Configuring the State of an Exception
          1. The TargetSite Property
          2. The StackTrace Property
          3. The HelpLink Property
          4. The Data Property
        5. System-Level Exceptions (System.SystemException)
        6. Application-Level Exceptions (System.ApplicationException)
          1. Building Custom Exceptions, Take 1
          2. Building Custom Exceptions, Take 2
          3. Building Custom Exceptions, Take 3
        7. Processing Multiple Exceptions
          1. General catch Statements
          2. Rethrowing Exceptions
          3. Inner Exceptions
          4. The finally Block
          5. Exception Filters
        8. Debugging Unhandled Exceptions Using Visual Studio
        9. Summary
      4. Chapter 8: Working with Interfaces
        1. Understanding Interface Types
          1. Interface Types vs. Abstract Base Classes
        2. Defining Custom Interfaces
        3. Implementing an Interface
        4. Invoking Interface Members at the Object Level
          1. Obtaining Interface References: The as Keyword
          2. Obtaining Interface References: The is Keyword
        5. Interfaces As Parameters
        6. Interfaces As Return Values
        7. Arrays of Interface Types
        8. Implementing Interfaces Using Visual Studio
        9. Explicit Interface Implementation
        10. Designing Interface Hierarchies
          1. Multiple Inheritance with Interface Types
        11. The IEnumerable and IEnumerator Interfaces
          1. Building Iterator Methods with the yield Keyword
          2. Building a Named Iterator
        12. The ICloneable Interface
          1. A More Elaborate Cloning Example
        13. The IComparable Interface
          1. Specifying Multiple Sort Orders with IComparer
          2. Custom Properties and Custom Sort Types
        14. Summary
    14. Part IV: Advanced C# Programming
      1. Chapter 9: Collections and Generics
        1. The Motivation for Collection Classes
          1. The System.Collections Namespace
          2. A Survey of System.Collections.Specialized Namespace
        2. The Problems of Nongeneric Collections
          1. The Issue of Performance
          2. The Issue of Type Safety
          3. A First Look at Generic Collections
        3. The Role of Generic Type Parameters
          1. Specifying Type Parameters for Generic Classes/Structures
          2. Specifying Type Parameters for Generic Members
          3. Specifying Type Parameters for Generic Interfaces
        4. The System.Collections.Generic Namespace
          1. Understanding Collection Initialization Syntax
          2. Working with the List<T> Class
          3. Working with the Stack<T> Class
          4. Working with the Queue<T> Class
          5. Working with the SortedSet<T> Class
          6. Working with the Dictionary<TKey, TValue> Class
        5. The System.Collections.ObjectModel Namespace
          1. Working with ObservableCollection<T>
        6. Creating Custom Generic Methods
          1. Inference of Type Parameters
        7. Creating Custom Generic Structures and Classes
          1. The default Keyword in Generic Code
        8. Constraining Type Parameters
          1. Examples Using the where Keyword
          2. The Lack of Operator Constraints
        9. Summary
      2. Chapter 10: Delegates, Events, and Lambda Expressions
        1. Understanding the .NET Delegate Type
          1. Defining a Delegate Type in C#
          2. The System.MulticastDelegate and System.Delegate Base Classes
        2. The Simplest Possible Delegate Example
          1. Investigating a Delegate Object
        3. Sending Object State Notifications Using Delegates
          1. Enabling Multicasting
          2. Removing Targets from a Delegate’s Invocation List
          3. Method Group Conversion Syntax
        4. Understanding Generic Delegates
          1. The Generic Action<> and Func<> Delegates
        5. Understanding C# Events
          1. The C# event Keyword
          2. Events Under the Hood
          3. Listening to Incoming Events
          4. Simplifying Event Registration Using Visual Studio
          5. Cleaning Up Event Invocation Using the C# 6.0 Null-Conditional Operator
          6. Creating Custom Event Arguments
          7. The Generic EventHandler<T> Delegate
        6. Understanding C# Anonymous Methods
          1. Accessing Local Variables
        7. Understanding Lambda Expressions
          1. Dissecting a Lambda Expression
          2. Processing Arguments Within Multiple Statements
          3. Lambda Expressions with Multiple (or Zero) Parameters
          4. Retrofitting the CarEvents Example Using Lambda Expressions
          5. Lambdas and Single Statement Member Implementations
        8. Summary
      3. Chapter 11: Advanced C# Language Features
        1. Understanding Indexer Methods
          1. Indexing Data Using String Values
          2. Overloading Indexer Methods
          3. Indexers with Multiple Dimensions
          4. Indexer Definitions on Interface Types
        2. Understanding Operator Overloading
          1. Overloading Binary Operators
          2. And What of the += and –+ Operators?
          3. Overloading Unary Operators
          4. Overloading Equality Operators
          5. Overloading Comparison Operators
          6. Final Thoughts Regarding Operator Overloading
        3. Understanding Custom Type Conversions
          1. Recall: Numerical Conversions
          2. Recall: Conversions Among Related Class Types
          3. Creating Custom Conversion Routines
          4. Additional Explicit Conversions for the Square Type
          5. Defining Implicit Conversion Routines
        4. Understanding Extension Methods
          1. Defining Extension Methods
          2. Invoking Extension Methods
          3. Importing Extension Methods
          4. The IntelliSense of Extension Methods
          5. Extending Types Implementing Specific Interfaces
        5. Understanding Anonymous Types
          1. Defining an Anonymous Type
          2. The Internal Representation of Anonymous Types
          3. The Implementation of ToString() and GetHashCode()
          4. The Semantics of Equality for Anonymous Types
          5. Anonymous Types Containing Anonymous Types
        6. Working with Pointer Types
          1. The unsafe Keyword
          2. Working with the * and & Operators
          3. An Unsafe (and Safe) Swap Function
          4. Field Access via Pointers (the -> Operator)
          5. The stackalloc Keyword
          6. Pinning a Type via the fixed Keyword
          7. The sizeof Keyword
        7. Summary
      4. Chapter 12: LINQ to Objects
        1. LINQ-Specific Programming Constructs
          1. Implicit Typing of Local Variables
          2. Object and Collection Initialization Syntax
          3. Lambda Expressions
          4. Extension Methods
          5. Anonymous Types
        2. Understanding the Role of LINQ
          1. LINQ Expressions Are Strongly Typed
          2. The Core LINQ Assemblies
        3. Applying LINQ Queries to Primitive Arrays
          1. Once Again, Without LINQ
          2. Reflecting over a LINQ Result Set
          3. LINQ and Implicitly Typed Local Variables
          4. LINQ and Extension Methods
          5. The Role of Deferred Execution
          6. The Role of Immediate Execution
        4. Returning the Result of a LINQ Query
          1. Returning LINQ Results via Immediate Execution
        5. Applying LINQ Queries to Collection Objects
          1. Accessing Contained Subobjects
          2. Applying LINQ Queries to Nongeneric Collections
          3. Filtering Data Using OfType<T>( )
        6. Investigating the C# LINQ Query Operators
          1. Basic Selection Syntax
          2. Obtaining Subsets of Data
          3. Projecting New Data Types
          4. Obtaining Counts Using Enumerable
          5. Reversing Result Sets
          6. Sorting Expressions
          7. LINQ As a Better Venn Diagramming Tool
          8. Removing Duplicates
          9. LINQ Aggregation Operations
        7. The Internal Representation of LINQ Query Statements
          1. Building Query Expressions with Query Operators (Revisited)
          2. Building Query Expressions Using the Enumerable Type and Lambda Expressions
          3. Building Query Expressions Using the Enumerable Type and Anonymous Methods
          4. Building Query Expressions Using the Enumerable Type and Raw Delegates
        8. Summary
      5. Chapter 13: Understanding Object Lifetime
        1. Classes, Objects, and References
        2. The Basics of Object Lifetime
          1. The CIL of new
          2. Setting Object References to null
        3. The Role of Application Roots
        4. Understanding Object Generations
        5. Concurrent Garbage Collection Prior to .NET 4.0
        6. Background Garbage Collection Under .NET 4.0 and Beyond
        7. The System.GC Type
          1. Forcing a Garbage Collection
        8. Building Finalizable Objects
          1. Overriding System.Object.Finalize()
          2. Detailing the Finalization Process
        9. Building Disposable Objects
          1. Reusing the C# using Keyword
        10. Building Finalizable and Disposable Types
          1. A Formalized Disposal Pattern
        11. Understanding Lazy Object Instantiation
          1. Customizing the Creation of the Lazy Data
        12. Summary
    15. Part V: Programming with .NET Assemblies
      1. Chapter 14: Building and Configuring Class Libraries
        1. Defining Custom Namespaces
          1. Resolving Name Clashes with Fully Qualified Names
          2. Resolving Name Clashes with Aliases
          3. Creating Nested Namespaces
          4. The Default Namespace of Visual Studio
        2. The Role of .NET Assemblies
          1. Assemblies Promote Code Reuse
          2. Assemblies Establish a Type Boundary
          3. Assemblies are Versionable Units
          4. Assemblies are Self-Describing
          5. Assemblies are Configurable
        3. Understanding the Format of a .NET Assembly
          1. The Windows File Header
          2. The CLR File Header
          3. CIL Code, Type Metadata, and the Assembly Manifest
          4. Optional Assembly Resources
        4. Building and Consuming Custom Class Library
          1. Exploring the Manifest
          2. Exploring the CIL
          3. Exploring the Type Metadata
          4. Building a C# Client Application
          5. Building a Visual Basic Client Application
          6. Cross-Language Inheritance in Action
        5. Understanding Private Assemblies
          1. The Identity of a Private Assembly
          2. Understanding the Probing Process
          3. Configuring Private Assemblies
          4. The Role of the App.Config File
        6. Understanding Shared Assemblies
          1. The Global Assembly Cache
          2. Understanding Strong Names
          3. Generating Strong Names at the Command Line
          4. Generating Strong Names Using Visual Studio
          5. Installing Strongly Named Assemblies to the GAC
        7. Consuming a Shared Assembly
          1. Exploring the Manifest of SharedCarLibClient
        8. Configuring Shared Assemblies
          1. Freezing the Current Shared Assembly
          2. Building a Shared Assembly Version 2.0.0.0
          3. Dynamically Redirecting to Specific Versions of a Shared Assembly
        9. Understanding Publisher Policy Assemblies
          1. Disabling Publisher Policy
        10. Understanding the <codeBase> Element
        11. The System.Configuration Namespace
        12. The Configuration File Schema Documentation
        13. Summary
      2. Chapter 15: Type Reflection, Late Binding, and Attribute-Based Programming
        1. The Necessity of Type Metadata
          1. Viewing (Partial) Metadata for the EngineState Enumeration
          2. Viewing (Partial) Metadata for the Car Type
          3. Examining a TypeRef
          4. Documenting the Defining Assembly
          5. Documenting Referenced Assemblies
          6. Documenting String Literals
        2. Understanding Reflection
          1. The System.Type Class
          2. Obtaining a Type Reference Using System.Object.GetType()
          3. Obtaining a Type Reference Using typeof()
          4. Obtaining a Type Reference Using System.Type.GetType()
        3. Building a Custom Metadata Viewer
          1. Reflecting on Methods
          2. Reflecting on Fields and Properties
          3. Reflecting on Implemented Interfaces
          4. Displaying Various Odds and Ends
          5. Implementing Main()
          6. Reflecting on Generic Types
          7. Reflecting on Method Parameters and Return Values
        4. Dynamically Loading Assemblies
        5. Reflecting on Shared Assemblies
        6. Understanding Late Binding
          1. The System.Activator Class
          2. Invoking Methods with No Parameters
          3. Invoking Methods with Parameters
        7. Understanding the Role of .NET Attributes
          1. Attribute Consumers
          2. Applying Attributes in C#
          3. C# Attribute Shorthand Notation
          4. Specifying Constructor Parameters for Attributes
          5. The Obsolete Attribute in Action
        8. Building Custom Attributes
          1. Applying Custom Attributes
          2. Named Property Syntax
          3. Restricting Attribute Usage
        9. Assembly-Level Attributes
          1. The Visual Studio AssemblyInfo.cs File
        10. Reflecting on Attributes Using Early Binding
        11. Reflecting on Attributes Using Late Binding
        12. Putting Reflection, Late Binding, and Custom Attributes in Perspective
        13. Building an Extendable Application
          1. Building CommonSnappableTypes.dll
          2. Building the C# Snap-In
          3. Building the Visual Basic Snap-In
          4. Building an Extendable Windows Forms Application
        14. Summary
      3. Chapter 16: Dynamic Types and the Dynamic Language Runtime
        1. The Role of the C# dynamic Keyword
          1. Calling Members on Dynamically Declared Data
          2. The Role of the Microsoft.CSharp.dll Assembly
          3. The Scope of the dynamic Keyword
          4. Limitations of the dynamic Keyword
          5. Practical Uses of the dynamic Keyword
        2. The Role of the Dynamic Language Runtime
          1. The Role of Expression Trees
          2. The Role of the System.Dynamic Namespace
          3. Dynamic Runtime Lookup of Expression Trees
        3. Simplifying Late-Bound Calls Using Dynamic Types
          1. Leveraging the dynamic Keyword to Pass Arguments
        4. Simplifying COM Interoperability Using Dynamic Data
          1. The Role of Primary Interop Assemblies
          2. Embedding Interop Metadata
          3. Common COM Interop Pain Points
        5. COM Interop Using C# Dynamic Data
          1. COM interop Without C# Dynamic Data
        6. Summary
      4. Chapter 17: Processes, AppDomains, and Object Contexts
        1. The Role of a Windows Process
          1. The Role of Threads
        2. Interacting with Processes Under the .NET Platform
          1. Enumerating Running Processes
          2. Investigating a Specific Process
          3. Investigating a Process’s Thread Set
          4. Investigating a Process’s Module Set
          5. Starting and Stopping Processes Programmatically
          6. Controlling Process Startup Using the ProcessStartInfo Class
        3. Understanding .NET Application Domains
          1. The System.AppDomain Class
        4. Interacting with the Default Application Domain
          1. Enumerating Loaded Assemblies
          2. Receiving Assembly Load Notifications
        5. Creating New Application Domains
          1. Loading Assemblies into Custom Application Domains
          2. Programmatically Unloading AppDomains
        6. Understanding Object Context Boundaries
          1. Context-Agile and Context-Bound Types
          2. Defining a Context-Bound Object
          3. Inspecting an Object’s Context
        7. Summarizing Processes, AppDomains, and Context
        8. Summary
      5. Chapter 18: Understanding CIL and the Role of Dynamic Assemblies
        1. Motivations for Learning the Grammar of CIL
        2. Examining CIL Directives, Attributes, and Opcodes
          1. The Role of CIL Directives
          2. The Role of CIL Attributes
          3. The Role of CIL Opcodes
          4. The CIL Opcode/CIL Mnemonic Distinction
        3. Pushing and Popping: The Stack-Based Nature of CIL
        4. Understanding Round-Trip Engineering
          1. The Role of CIL Code Labels
          2. Interacting with CIL: Modifying an *.il File
          3. Compiling CIL Code Using ilasm.exe
          4. The Role of peverify.exe
        5. Understanding CIL Directives and Attributes
          1. Specifying Externally Referenced Assemblies in CIL
          2. Defining the Current Assembly in CIL
          3. Defining Namespaces in CIL
          4. Defining Class Types in CIL
          5. Defining and Implementing Interfaces in CIL
          6. Defining Structures in CIL
          7. Defining Enums in CIL
          8. Defining Generics in CIL
          9. Compiling the CILTypes.il file
        6. .NET Base Class Library, C#, and CIL Data Type Mappings
        7. Defining Type Members in CIL
          1. Defining Field Data in CIL
          2. Defining Type Constructors in CIL
          3. Defining Properties in CIL
          4. Defining Member Parameters
        8. Examining CIL Opcodes
          1. The .maxstack Directive
          2. Declaring Local Variables in CIL
          3. Mapping Parameters to Local Variables in CIL
          4. The Hidden this Reference
          5. Representing Iteration Constructs in CIL
        9. Building a .NET Assembly with CIL
          1. Building CILCars.dll
          2. Building CILCarClient.exe
        10. Understanding Dynamic Assemblies
          1. Exploring the System.Reflection.Emit Namespace
          2. The Role of the System.Reflection.Emit.ILGenerator
          3. Emitting a Dynamic Assembly
          4. Emitting the Assembly and Module Set
          5. The Role of the ModuleBuilder Type
          6. Emitting the HelloClass Type and the String Member Variable
          7. Emitting the Constructors
          8. Emitting the SayHello() Method
          9. Using the Dynamically Generated Assembly
        11. Summary
    16. Part VI: Introducing the .NET Base Class Libraries
      1. Chapter 19: Multithreaded, Parallel, and Async Programming
        1. The Process/AppDomain/Context/Thread Relationship
          1. The Problem of Concurrency
          2. The Role of Thread Synchronization
        2. A Brief Review of the .NET Delegate
        3. The Asynchronous Nature of Delegates
          1. The BeginInvoke() and EndInvoke() Methods
          2. The System.IAsyncResult Interface
        4. Invoking a Method Asynchronously
          1. Synchronizing the Calling Thread
          2. The Role of the AsyncCallback Delegate
          3. The Role of the AsyncResult Class
          4. Passing and Receiving Custom State Data
        5. The System.Threading Namespace
        6. The System.Threading.Thread Class
          1. Obtaining Statistics About the Current Thread of Execution
          2. The Name Property
          3. The Priority Property
        7. Manually Creating Secondary Threads
          1. Working with the ThreadStart Delegate
          2. Working with the ParameterizedThreadStart Delegate
          3. The AutoResetEvent Class
          4. Foreground Threads and Background Threads
        8. The Issue of Concurrency
          1. Synchronization Using the C# lock Keyword
          2. Synchronization Using the System.Threading.Monitor Type
          3. Synchronization Using the System.Threading.Interlocked Type
          4. Synchronization Using the [Synchronization] Attribute
        9. Programming with Timer Callbacks
        10. Understanding the CLR ThreadPool
        11. Parallel Programming Using the Task Parallel Library
          1. The System.Threading.Tasks Namespace
          2. The Role of the Parallel Class
          3. Data Parallelism with the Parallel Class
          4. Accessing UI Elements on Secondary Threads
          5. The Task Class
          6. Handling Cancellation Request
          7. Task Parallelism Using the Parallel Class
        12. Parallel LINQ Queries (PLINQ)
          1. Opting in to a PLINQ Query
          2. Cancelling a PLINQ Query
        13. Asynchronous Calls with the async Keyword
          1. A First Look at the C# async and await Keywords
          2. Naming Conventions for Async Methods
          3. Async Methods Returning Void
          4. Async Methods with Multiple Awaits
          5. Retrofitting the AddWithThreads Example Using Asycn/Await
        14. Summary
      2. Chapter 20: File I/O and Object Serialization
        1. Exploring the System.IO Namespace
        2. The Directory(Info) and File(Info) Types
          1. The Abstract FileSystemInfo Base Class
        3. Working with the DirectoryInfo Type
          1. Enumerating Files with the DirectoryInfo Type
          2. Creating Subdirectories with the DirectoryInfo Type
        4. Working with the Directory Type
        5. Working with the DriveInfo Class Type
        6. Working with the FileInfo Class
          1. The FileInfo.Create() Method
          2. The FileInfo.Open() Method
          3. The FileInfo.OpenRead() and FileInfo.OpenWrite() Methods
          4. The FileInfo.OpenText() Method
          5. The FileInfo.CreateText() and FileInfo.AppendText() Methods
        7. Working with the File Type
          1. Additional File-Centric Members
        8. The Abstract Stream Class
          1. Working with FileStreams
        9. Working with StreamWriters and StreamReaders
          1. Writing to a Text File
          2. Reading from a Text File
          3. Directly Creating StreamWriter/StreamReader Types
        10. Working with StringWriters and StringReaders
        11. Working with BinaryWriters and BinaryReaders
        12. Watching Files Programmatically
        13. Understanding Object Serialization
          1. The Role of Object Graphs
        14. Configuring Objects for Serialization
          1. Defining Serializable Types
          2. Public Fields, Private Fields, and Public Properties
        15. Choosing a Serialization Formatter
          1. The IFormatter and IRemotingFormatter Interfaces
          2. Type Fidelity Among the Formatters
        16. Serializing Objects Using the BinaryFormatter
          1. Deserializing Objects Using the BinaryFormatter
        17. Serializing Objects Using the SoapFormatter
        18. Serializing Objects Using the XmlSerializer
          1. Controlling the Generated XML Data
        19. Serializing Collections of Objects
        20. Customizing the Soap/Binary Serialization Process
          1. A Deeper Look at Object Serialization
          2. Customizing Serialization Using ISerializable
          3. Customizing Serialization Using Attributes
        21. Summary
      3. Chapter 21: ADO.NET Part I: The Connected Layer
        1. A High-Level Definition of ADO.NET
          1. The Three Faces of ADO.NET
        2. Understanding ADO.NET Data Providers
          1. The Microsoft-Supplied ADO.NET Data Providers
          2. A Word Regarding System.Data.OracleClient.dll
          3. Obtaining Third-Party ADO.NET Data Providers
        3. Additional ADO.NET Namespaces
        4. The Types of the System.Data Namespace
          1. The Role of the IDbConnection Interface
          2. The Role of the IDbTransaction Interface
          3. The Role of the IDbCommand Interface
          4. The Role of the IDbDataParameter and IDataParameter Interfaces
          5. The Role of the IDbDataAdapter and IDataAdapter Interfaces
          6. The Role of the IDataReader and IDataRecord Interfaces
        5. Abstracting Data Providers Using Interfaces
          1. Increasing Flexibility Using Application Configuration Files
        6. Creating the AutoLot Database
          1. Creating the Inventory Table
          2. Adding Test Records to the Inventory Table
          3. Authoring the GetPetName() Stored Procedure
          4. Creating the Customers and Orders Tables
          5. Creating Table Relationships in Visual Studio
        7. The ADO.NET Data Provider Factory Model
          1. A Complete Data Provider Factory Example
          2. A Potential Drawback with the Data Provider Factory Model
          3. The <connectionStrings> Element
        8. Understanding the Connected Layer of ADO.NET
          1. Working with Connection Objects
          2. Working with ConnectionStringBuilder Objects
          3. Working with Command Objects
        9. Working with Data Readers
          1. Obtaining Multiple Result Sets Using a Data Reader
        10. Building a Reusable Data Access Library
          1. Adding the Connection Logic
          2. Adding the Insertion Logic
          3. Adding the Deletion Logic
          4. Adding the Update Logic
          5. Adding the Selection Logic
          6. Working with Parameterized Command Objects
          7. Specifying Parameters Using the DbParameter Type
          8. Executing a Stored Procedure
        11. Creating a Console UI–Based Front End
          1. Implementing the Main() Method
          2. Implementing the ShowInstructions(?) Method
          3. Implementing the ListInventory(?) Method
          4. Implementing the DeleteCar() Method
          5. Implementing the InsertNewCar() Method
          6. Implementing the UpdateCarPetName() Method
          7. Implementing LookUpPetName()
        12. Understanding Database Transactions
          1. Key Members of an ADO.NET Transaction Object
          2. Adding a CreditRisks Table to the AutoLot Database
          3. Adding a Transaction Method to InventoryDAL
          4. Testing Your Database Transaction
        13. Summary
      4. Chapter 22: ADO.NET Part II: The Disconnected Layer
        1. Understanding the Disconnected Layer of ADO.NET
        2. Understanding the Role of the DataSet
          1. Key Properties of the DataSet
          2. Key Methods of the DataSet
          3. Building a DataSet
        3. Working with DataColumns
          1. Building a DataColumn
          2. Enabling Autoincrementing Fields
          3. Adding DataColumn Objects to a DataTable
        4. Working with DataRows
          1. Understanding the RowState Property
          2. Understanding the DataRowVersion Property
        5. Working with DataTables
          1. Inserting DataTables into DataSets
          2. Obtaining Data in a DataSet
          3. Processing DataTable Data Using DataTableReader Objects
          4. Serializing DataTable/DataSet Objects As XML
          5. Serializing DataTable/DataSet Objects in a Binary Format
        6. Binding DataTable Objects to Windows Forms GUIs
          1. Hydrating a DataTable from a Generic List<T>
          2. Deleting Rows from a DataTable
          3. Selecting Rows Based on Filter Criteria
          4. Updating Rows Within a DataTable
          5. Working with the DataView Type
        7. Working with Data Adapters
          1. A Simple Data Adapter Example
          2. Mapping Database Names to Friendly Names
        8. Adding Disconnected Functionality to AutoLotDAL.dll
          1. Defining the Initial Class Type
          2. Configuring the Data Adapter Using the SqlCommandBuilder
          3. Implementing GetAllInventory()
          4. Implementing UpdateInventory()
          5. Setting Your Version Number
          6. Testing the Disconnected Functionality
        9. Multitabled DataSet Objects and Data Relationships
          1. Prepping the Data Adapters
          2. Building the Table Relationships
          3. Updating the Database Tables
          4. Navigating Between Related Tables
        10. The Windows Forms Database Designer Tools
          1. Visually Designing the DataGridView
          2. The Generated App.config File
          3. Examining the Strongly Typed DataSet
          4. Examining the Strongly Typed DataTable
          5. Examining the Strongly Typed DataRow
          6. Examining the Strongly Typed Data Adapter
          7. Completing the Windows Forms Application
        11. Isolating Strongly Typed Database Code into a Class Library
          1. Viewing the Generated Code
          2. Selecting Data with the Generated Code
          3. Inserting Data with the Generated Code
          4. Deleting Data with the Generated Code
          5. Invoking a Stored Procedure Using the Generated Code
        12. Programming with LINQ to DataSet
          1. The Role of the DataSet Extensions Library
          2. Obtaining a LINQ-Compatible DataTable
          3. The Role of the DataRowExtensions.Field<T>() Extension Method
          4. Hydrating New DataTables from LINQ Queries
        13. Summary
      5. Chapter 23: ADO.NET Part III: Entity Framework
        1. Understanding the Role of the Entity Framework
          1. The Role of Entities
          2. The Building Blocks of the Entity Framework
        2. Code First from an Existing Database
          1. Generating the Model
          2. What Did That Do?
          3. Changing the Default Mappings
          4. Adding to the Generated Model Classes
        3. Using the Model Classes in Code
          1. Inserting a Record
          2. Selecting Records
          3. The Role of Navigation Properties
          4. Deleting a Record
          5. Updating a Record
        4. Handling Database Changes
        5. AutoLotDAL Version 4
          1. Entity Framework Data Annotations
          2. Adding or Updating the Model Classes
          3. Adding the DbContext
          4. Adding the Repositories
          5. Initializing the Database
        6. Test-Driving AutoLotDAL
          1. Printing All Inventory Records
          2. Adding Inventory Records
          3. Editing Records
          4. Using Navigation Properties
          5. Multitable Actions/Implicit Transactions
        7. Entity Framework Migrations
          1. Updating the Model
          2. Testing the App
          3. Entering EF Migrations
          4. Creating the Baseline Migration
          5. Seeding the Database
        8. Revisiting the Transaction Test
        9. Concurrency
          1. Correcting the Repositories
          2. Testing Concurrency
        10. Interception
          1. The IDbCommandInterceptor Interface
          2. Adding Interception to AutoLotDAL
          3. Registering the Interceptor
          4. Adding the DatabaseLogger Interceptor
        11. ObjectMaterialized and SavingChanges Events
          1. Accessing the Object Context
          2. ObjectMaterialized
          3. SavingChanges
        12. Deploying to SQL Server
        13. Summary
      6. Chapter 24: Introducing LINQ to XML
        1. A Tale of Two XML APIs
          1. LINQ to XML As a Better DOM
          2. VB Literal Syntax As a Better LINQ to XML
        2. Members of the System.Xml.Linq Namespace
          1. The LINQ to XML Axis Methods
          2. The Oddness of XName (and XNamespace)
        3. Working with XElement and XDocument
          1. Generating Documents from Arrays and Containers
          2. Loading and Parsing XML Content
        4. Manipulating an In-Memory XML Document
          1. Building the UI of the LINQ to XML App
          2. Import the Inventory.xml File
          3. Defining a LINQ to XML Helper Class
          4. Attaching the UI to Your Helper Class
        5. Summary
      7. Chapter 25: Introducing Windows Communication Foundation
        1. A Potpourri of Distributed Computing APIs
          1. The Role of DCOM
          2. The Role of COM+/Enterprise Services
          3. The Role of MSMQ
          4. The Role of .NET Remoting
          5. The Role of XML Web Services
          6. Web Service Standards
        2. The Role of WCF
          1. An Overview of WCF Features
          2. An Overview of Service-Oriented Architecture
          3. Tenet 1: Boundaries are Explicit
          4. Tenet 2: Services are Autonomous
          5. Tenet 3: Services Communicate via Contract, Not Implementation
          6. Tenet 4: Service Compatibility is Based on Policy
          7. WCF: The Bottom Line
        3. Investigating the Core WCF Assemblies
        4. The Visual Studio WCF Project Templates
          1. The WCF Service Web Site Project Template
        5. The Basic Composition of a WCF Application
        6. The ABCs of WCF
          1. Understanding WCF Contracts
          2. Understanding WCF Bindings
          3. HTTP-Based Bindings
          4. TCP-Based Bindings
          5. MSMQ-Based Bindings
          6. Understanding WCF Addresses
        7. Building a WCF Service
          1. The [ServiceContract] Attribute
          2. The [OperationContract] Attribute
          3. Service Types As Operational Contracts
        8. Hosting the WCF Service
          1. Establishing the ABCs Within an App.config File
          2. Coding Against the ServiceHost Type
          3. Specifying Base Addresses
          4. Details of the ServiceHost Type
          5. Details of the <system.serviceModel> Element
          6. Enabling Metadata Exchange
        9. Building the WCF Client Application
          1. Generating Proxy Code Using svcutil.exe
          2. Generating Proxy Code Using Visual Studio
          3. Configuring a TCP-Based Binding
        10. Simplifying Configuration Settings
          1. Leveraging Default Endpoints
          2. Exposing a Single WCF Service Using Multiple Bindings
          3. Changing Settings for a WCF Binding
          4. Leveraging the Default MEX Behavior Configuration
          5. Refreshing the Client Proxy and Selecting the Binding
        11. Using the WCF Service Library Project Template
          1. Building a Simple Math Service
          2. Testing the WCF Service with WcfTestClient.exe
          3. Altering Configuration Files Using SvcConfigEditor.exe
        12. Hosting the WCF Service Within a Windows Service
          1. Specifying the ABCs in Code
          2. Enabling MEX
          3. Creating a Windows Service Installer
          4. Installing the Windows Service
        13. Invoking a Service Asynchronously from the Client
        14. Designing WCF Data Contracts
          1. Using the Web-centric WCF Service Project Template
          2. Implementing the Service Contract
          3. The Role of the *.svc File
          4. Examining the Web.config File
          5. Testing the Service
        15. Summary
    17. Part VII: Windows Presentation Foundation
      1. Chapter 26: Introducing Windows Presentation Foundation and XAML
        1. The Motivation Behind WPF
          1. Unifying Diverse APIs
          2. Providing a Separation of Concerns via XAML
          3. Providing an Optimized Rendering Model
          4. Simplifying Complex UI Programming
        2. The Various Flavors of WPF
          1. Traditional Desktop Applications
          2. Navigation-Based WPF Applications
          3. XBAP Applications
          4. The WPF/Silverlight Relationship
        3. Investigating the WPF Assemblies
          1. The Role of the Application Class
          2. Constructing an Application Class
          3. Enumerating the Windows Collection
          4. The Role of the Window Class
        4. Building a WPF Application Without XAML
          1. Creating a Strongly Typed Window
          2. Creating a Simple User Interface
          3. Interacting with Application-Level Data
          4. Handling the Closing of a Window Object
          5. Intercepting Mouse Events
          6. Intercepting Keyboard Events
        5. Building a WPF Application Using Only XAML
          1. Defining a Window Object in XAML
          2. Defining the Application Object in XAML
          3. Processing the XAML Files Using msbuild.exe
        6. Transforming Markup into a .NET Assembly
          1. Mapping the Window XAML Markup to C# Code
          2. The Role of BAML
          3. Mapping the Application XAML Markup to C# Code
          4. XAML-to-Assembly Process Summary
        7. Understanding the Syntax of WPF XAML
          1. Introducing Kaxaml
          2. XAML XML Namespaces and XAML “Keywords”
          3. Controlling Class and Member Variable Visibility
          4. XAML Elements, XAML Attributes, and Type Converters
          5. Understanding XAML Property-Element Syntax
          6. Understanding XAML Attached Properties
          7. Understanding XAML Markup Extensions
        8. Building a WPF Application Using Code-Behind Files
          1. Adding a Code File for the MainWindow Class
          2. Adding a Code File for the MyApp Class
          3. Processing the Code Files with msbuild.exe
        9. Building WPF Applications Using Visual Studio
          1. The WPF Project Templates
          2. The Toolbox and XAML Designer/Editor
          3. Setting Properties Using the Properties Window
          4. Handling Events Using the Properties Window
          5. Handling Events in the XAML Editor
          6. The Document Outline Window
          7. Viewing the Autogenerated Code Files
        10. Building a Custom XAML Editor with Visual Studio
          1. Designing the GUI of Your Window
          2. Implementing the Loaded Event
          3. Implementing the Button’s Click Event
          4. Implementing the Closed Event
          5. Testing Your Application
          6. Exploring the WPF Documentation
        11. Summary
      2. Chapter 27: Programming with WPF Controls
        1. A Survey of the Core WPF Controls
          1. The WPF Ink Controls
          2. The WPF Document Controls
          3. WPF Common Dialog Boxes
          4. The Details Are in the Documentation
        2. A Brief Review of the Visual Studio WPF Designer
          1. Working with WPF Controls Using Visual Studio
          2. Working with the Document Outline Editor
        3. Controlling Content Layout Using Panels
          1. Positioning Content Within Canvas Panels
          2. Positioning Content Within WrapPanel Panels
          3. Positioning Content Within StackPanel Panels
          4. Positioning Content Within Grid Panels
          5. Grids with GridSplitter Types
          6. Positioning Content Within DockPanel Panels
          7. Enabling Scrolling for Panel Types
          8. Configuring Panels Using the Visual Studio Designers
        4. Building a Window’s Frame Using Nested Panels
          1. Building the Menu System
          2. Building Menus Visually
          3. Building the ToolBar
          4. Building the StatusBar
          5. Finalizing the UI Design
          6. Implementing the MouseEnter/MouseLeave Event Handlers
          7. Implementing the Spell Checking Logic
        5. Understanding WPF Commands
          1. The Intrinsic Command Objects
          2. Connecting Commands to the Command Property
          3. Connecting Commands to Arbitrary Actions
          4. Working with the Open and Save Commands
        6. Understanding Routed Events
          1. The Role of Routed Bubbling Events
          2. Continuing or Halting Bubbling
          3. The Role of Routed Tunneling Events
        7. A Deeper Look at WPF APIs and Controls
          1. Working with the TabControl
        8. Building the Ink API Tab
          1. Designing the ToolBar
          2. The RadioButton Control
          3. Handling Events for the Ink API Tab
          4. The InkCanvas Control
          5. The ComboBox Control
          6. Saving, Loading, and Clearing InkCanvas Data
        9. Introducing the Documents API
          1. Block Elements and Inline Elements
          2. Document Layout Managers
        10. Building the Documents Tab
          1. Populating a FlowDocument Using Code
          2. Enabling Annotations and Sticky Notes
          3. Saving and Loading a Flow Document
        11. Introducing the WPF Data-Binding Model
          1. Building the Data Binding Tab
          2. Establishing Data Bindings Using Visual Studio
          3. The DataContext Property
          4. Data Conversion Using IValueConverter
          5. Establishing Data Bindings in Code
          6. Building the DataGrid Tab
        12. Understanding the Role of Dependency Properties
          1. Examining an Existing Dependency Property
          2. Important Notes Regarding CLR Property Wrappers
        13. Building a Custom Dependency Property
          1. Adding a Data Validation Routine
          2. Responding to the Property Change
        14. Summary
      3. Chapter 28: WPF Graphics Rendering Services
        1. Understanding WPF’s Graphical Rendering Services
          1. WPF Graphical Rendering Options
        2. Rendering Graphical Data Using Shapes
          1. Adding Rectangles, Ellipses, and Lines to a Canvas
          2. Removing Rectangles, Ellipses, and Lines from a Canvas
          3. Working with Polylines and Polygons
          4. Working with Paths
        3. WPF Brushes and Pens
          1. Configuring Brushes Using Visual Studio
          2. Configuring Brushes in Code
          3. Configuring Pens
        4. Applying Graphical Transformations
          1. A First Look at Transformations
          2. Transforming Your Canvas Data
        5. Working with the Visual Studio Transform Editor
          1. Building the Initial Layout
          2. Applying Transformations at Design Time
          3. Transforming the Canvas in Code
        6. Rendering Graphical Data Using Drawings and Geometries
          1. Building a DrawingBrush Using Geometries
          2. Painting with the DrawingBrush
          3. Containing Drawing Types in a DrawingImage
        7. Working with Vector Images
          1. Converting a Sample Vector Graphic File into XAML
          2. Importing the Graphical Data into a WPF Project
          3. Interacting with the Sign
        8. Rendering Graphical Data Using the Visual Layer
          1. The Visual Base Class and Derived Child Classes
          2. A First Look at Using the DrawingVisual Class
          3. Rendering Visual Data to a Custom Layout Manager
          4. Responding to Hit-Test Operations
        9. Summary
      4. Chapter 29: WPF Resources, Animations, Styles, and Templates
        1. Understanding the WPF Resource System
          1. Working with Binary Resources
        2. Working with Object (Logical) Resources
          1. The Role of the Resources Property
          2. Defining Window-Wide Resources
          3. The {StaticResource} Markup Extension
          4. The {DynamicResource} Markup Extension
          5. Application-Level Resources
          6. Defining Merged Resource Dictionaries
          7. Defining a Resource-Only Assembly
        3. Understanding WPF’s Animation Services
          1. The Role of the Animation Class Types
          2. The To, From, and By Properties
          3. The Role of the Timeline Base Class
          4. Authoring an Animation in C# Code
          5. Controlling the Pace of an Animation
          6. Reversing and Looping an Animation
        4. Authoring Animations in XAML
          1. The Role of Storyboards
          2. The Role of Event Triggers
          3. Animation Using Discrete Key Frames
        5. Understanding the Role of WPF Styles
          1. Defining and Applying a Style
          2. Overriding Style Settings
          3. Limiting Application of a Style with TargetType
          4. Automatically Applying a Style with TargetType
          5. Subclassing Existing Styles
          6. Defining Styles with Triggers
          7. Defining Styles with Multiple Triggers
          8. Animated Styles
          9. Assigning Styles Programmatically
        6. Logical Trees, Visual Trees, and Default Templates
          1. Programmatically Inspecting a Logical Tree
          2. Programmatically Inspecting a Visual Tree
          3. Programmatically Inspecting a Control’s Default Template
        7. Building a Control Template with the Trigger Framework
          1. Templates as Resources
          2. Incorporating Visual Cues Using Triggers
          3. The Role of the {TemplateBinding} Markup Extension
          4. The Role of ContentPresenter
          5. Incorporating Templates into Styles
        8. Summary
      5. Chapter 30: Notifications, Commands, Validation, and MVVM
        1. Introducing Model-View-ViewModel
          1. Model
          2. View
          3. ViewModel
          4. Anemic Models or ViewModels
        2. The WPF Binding Notification System
          1. Observable Models and Collections
          2. Adding Bindings and Data
          3. Programmatically Changing the Vehicle Data
          4. Observable Models
          5. Observable Collections
        3. Validation
          1. Updating the Sample for the Validation Examples
          2. The Validation Class
          3. Validation Options
        4. Using Data Annotations
          1. Adding Data Annotations
          2. Checking for Data Annotation-Based Validation Errors
          3. Customizing the ErrorTemplate
        5. Creating Custom Commands
          1. Implementing the ICommand Interface
          2. Updating MainWindow.xaml.cs
          3. Updating MainWindow.xaml
          4. Attaching Command to the CommandManager
          5. Testing the Application
          6. Adding the Remaining Commands
        6. Fully Implementing MVVM
          1. Moving the Data Source Out of the View
          2. Moving the Commands to the ViewModel
        7. Updating AutoLotDAL for MVVM
          1. Updating the AutoLotDAL Models
        8. Full MVVM Example
          1. Using ObjectMaterialized with Entity Framework
        9. Summary
    18. Part VIII: ASP.NET
      1. Chapter 31: Introducing ASP.NET Web Forms
        1. The Role of HTTP
          1. The HTTP Request/Response Cycle
          2. HTTP Is a Stateless Protocol
        2. Understanding Web Applications and Web Servers
          1. The Role of IIS Virtual Directories
          2. IIS Express
        3. The Role of HTML
          1. HTML Document Structure
          2. The Role of an HTML Form
          3. The Visual Studio HTML Designer Tools
          4. Building an HTML Form
        4. The Role of Client-Side Scripting
          1. A Client-Side Scripting Example
        5. Posting Back to the Web Server
          1. Postbacks Under Web Forms
        6. An Overview of the Web Forms API
          1. Major Features of Web Forms 2.0 and Higher
          2. Major Features of Web Forms 3.5 (and .NET 3.5 SP1) and Higher
          3. Major Features of Web Forms 4.0
          4. Major Features of Web Forms 4.5 and 4.6
        7. Building a Single-File Web Forms Web App
          1. Referencing AutoLotDAL.dll
          2. Designing the UI
          3. Adding the Data Access Logic
          4. The Role of ASP.NET Directives
          5. Analyzing the “Script” Block
          6. Analyzing the ASP.NET Control Declarations
        8. Building an ASP.NET Web Page Using Code Files
          1. Reference the AutoLotDAL Project
          2. Updating the Code File
          3. Debugging and Tracing ASP.NET Pages
        9. ASP.NET Web Sites vs. ASP.NET Web Applications
          1. Enabling C# 6 For ASP.NET Web Sites
        10. The ASP.NET Web Site Directory Structure
          1. Referencing Assemblies
          2. The Role of the App_Code Folder
        11. The Inheritance Chain of the Page Type
        12. Interacting with the Incoming HTTP Request
          1. Obtaining Browser Statistics
          2. Access to Incoming Form Data
          3. The IsPostBack Property
        13. Interacting with the Outgoing HTTP Response
          1. Emitting HTML Content
          2. Redirecting Users
        14. The Life Cycle of an ASP.NET Web Page
          1. The Role of the AutoEventWireup Attribute
          2. The Error Event
        15. The Role of the Web.config File
          1. The ASP.NET Web Site Administration Utility
        16. Summary
      2. Chapter 32: ASP.NET Web Controls, Master Pages, and Themes
        1. Understanding the Nature of Web Controls
          1. Understanding Server-Side Event Handling
          2. The AutoPostBack Property
        2. The Control and WebControl Base Classes
          1. Enumerating Contained Controls
          2. Dynamically Adding and Removing Controls
          3. Interacting with Dynamically Created Controls
          4. Functionality of the WebControl Base Class
        3. Major Categories of Web Forms Controls
          1. A Brief Word Regarding System.Web.UI.HtmlControls
          2. Web Control Documentation
        4. Building the Web Forms Cars Web Site
          1. Working with Web Forms Master Pages
          2. Configuring the TreeView Control Site Navigation Logic
          3. Establishing Breadcrumbs with the SiteMapPath Type
          4. Configuring the AdRotator Control
          5. Defining the Default Content Page
          6. Designing the Inventory Content Page
          7. Adding AutoLotDAL and Entity Framework to AspNetCarsSite
          8. Filling the GridView with Data
          9. Enabling In-Place Editing
          10. Enabling Sorting and Paging
          11. Enabling Filtering
          12. Designing the Build-a-Car Content Page
        5. The Role of the Validation Controls
          1. Enabling Client-Side JavaScript Validation Support
          2. The RequiredFieldValidator
          3. The RegularExpressionValidator
          4. The RangeValidator
          5. The CompareValidator
          6. Creating Validation Summaries
          7. Defining Validation Groups
          8. Validation with Data Annotations
        6. Working with Themes
          1. Understanding *.skin Files
          2. Applying Site-Wide Themes
          3. Applying Themes at the Page Level
          4. The SkinID Property
          5. Assigning Themes Programmatically
        7. Summary
      3. Chapter 33: ASP.NET State Management Techniques
        1. The Issue of State
        2. ASP.NET State Management Techniques
        3. Understanding the Role of ASP.NET View State
          1. Demonstrating View State
          2. Adding Custom View State Data
        4. The Role of the Global.asax File
          1. The Global Last-Chance Exception Event Handler
          2. The HttpApplication Base Class
        5. Understanding the Application/Session Distinction
          1. Maintaining Application-Level State Data
          2. Modifying Application Data
          3. Handling Web Application Shutdown
        6. Working with the Application Cache
          1. Fun with Data Caching
          2. Modifying the *.aspx File
        7. Maintaining Session Data
          1. Additional Members of HttpSessionState
        8. Understanding Cookies
          1. Creating Cookies
          2. Reading Incoming Cookie Data
        9. The Role of the <sessionState> Element
          1. Storing Session Data in the ASP.NET Session State Server
          2. Storing Session Data in a Dedicated Database
        10. Introducing the ASP.NET Profile API
          1. The ASPNETDB.mdf Database
          2. Defining a User Profile Within web.config
          3. Accessing Profile Data Programmatically
          4. Grouping Profile Data and Persisting Custom Objects
        11. Summary
      4. Chapter 34: ASP.NET MVC and Web API
        1. Introducing the MVC Pattern
          1. The Model
          2. The View
          3. The Controller
          4. Why MVC?
          5. Enter ASP.NET MVC
        2. Building Your First ASP.NET MVC Application
          1. The New Project Wizard
          2. The Components of a Base MVC Project
          3. Updating NuGet Packages to Current Versions
          4. Test-Drive Your Site
        3. Routing
          1. URL Patterns
          2. Creating Routes for the Contact and About Pages
          3. Redirecting Users Using Routing
        4. Adding AutoLotDAL
        5. Controllers and Actions
          1. Adding the Inventory Controller
          2. Examine the Scaffolded Views
          3. MVC Controllers
        6. MVC Views
          1. The Razor View Engine
          2. Layouts
          3. Partial Views
          4. Sending Data to the View
          5. The Index View
          6. The Details View
          7. The Create View
          8. The Delete View
          9. The Edit View
          10. Validation
          11. Finishing the UI
          12. The Final Word on ASP.NET MVC
        7. Introducing ASP.NET Web API
          1. Adding the Web API Project
          2. Examining the Web API Project
          3. Configuring the Project
          4. A Note About JSON
          5. Adding a Controller
          6. Updating CarLotMVC to Use CarLotWebAPI
        8. Summary
    19. Index

    Product information

    • Title: C# 6.0 and the .NET 4.6 Framework, Seventh Edition
    • Author(s): Andrew Troelsen, Philip Japikse
    • Release date: December 2015
    • Publisher(s): Apress
    • ISBN: 9781484213322