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:
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
- Cover
- Title
- Copyright
- Dedication
- Contents at a Glance
- Contents
- About the Authors
- About the Technical Reviewer
- Acknowledgments
- Introduction
-
Part I: Introducing C# and the .NET Platform
-
Chapter 1: The Philosophy of .NET
- An Initial Look at the .NET Platform
- Introducing the Building Blocks of the .NET Platform (the CLR, CTS, and CLS)
- Additional .NET-Aware Programming Languages
- An Overview of .NET Assemblies
- Understanding the Common Type System
- Understanding the Common Language Specification
- Understanding the Common Language Runtime
- The Assembly/Namespace/Type Distinction
- Exploring an Assembly Using ildasm.exe
- The Platform-Independent Nature of .NET
- Summary
- Chapter 2: Building C# Applications
-
Chapter 1: The Philosophy of .NET
-
Part II: Core C# Programming
-
Chapter 3: Core C# Programming Constructs, Part I
- The Anatomy of a Simple C# Program
- An Interesting Aside: Some Additional Members of the System.Environment Class
- The System.Console Class
- System Data Types and Corresponding C# Keywords
- Working with String Data
- Narrowing and Widening Data Type Conversions
- Understanding Implicitly Typed Local Variables
- C# Iteration Constructs
- Decision Constructs and the Relational/Equality Operators
- Summary
- Chapter 4: Core C# Programming Constructs, Part II
-
Chapter 3: Core C# Programming Constructs, Part I
-
Part III: Object-Oriented Programming with C#
-
Chapter 5: Understanding Encapsulation
- Introducing the C# Class Type
- Understanding Constructors
- The Role of the this Keyword
- Understanding the static Keyword
- Defining the Pillars of OOP
- C# Access Modifiers
- The First Pillar: C#’s Encapsulation Services
- Understanding Automatic Properties
- Understanding Object Initialization Syntax
- Working with Constant Field Data
- Understanding Partial Classes
- Summary
-
Chapter 6: Understanding Inheritance and Polymorphism
- The Basic Mechanics of Inheritance
- Revising Visual Studio Class Diagrams
- The Second Pillar of OOP: The Details of Inheritance
- Programming for Containment/Delegation
- The Third Pillar of OOP: C#’s Polymorphic Support
- Understanding Base Class/Derived Class Casting Rules
- The Master Parent Class: System.Object
- Summary
-
Chapter 7: Understanding Structured Exception Handling
- Ode to Errors, Bugs, and Exceptions
- The Role of .NET Exception Handling
- The Simplest Possible Example
- Configuring the State of an Exception
- System-Level Exceptions (System.SystemException)
- Application-Level Exceptions (System.ApplicationException)
- Processing Multiple Exceptions
- Debugging Unhandled Exceptions Using Visual Studio
- Summary
-
Chapter 8: Working with Interfaces
- Understanding Interface Types
- Defining Custom Interfaces
- Implementing an Interface
- Invoking Interface Members at the Object Level
- Interfaces As Parameters
- Interfaces As Return Values
- Arrays of Interface Types
- Implementing Interfaces Using Visual Studio
- Explicit Interface Implementation
- Designing Interface Hierarchies
- The IEnumerable and IEnumerator Interfaces
- The ICloneable Interface
- The IComparable Interface
- Summary
-
Chapter 5: Understanding Encapsulation
-
Part IV: Advanced C# Programming
-
Chapter 9: Collections and Generics
- The Motivation for Collection Classes
- The Problems of Nongeneric Collections
- The Role of Generic Type Parameters
- The System.Collections.Generic Namespace
- The System.Collections.ObjectModel Namespace
- Creating Custom Generic Methods
- Creating Custom Generic Structures and Classes
- Constraining Type Parameters
- Summary
- Chapter 10: Delegates, Events, and Lambda Expressions
- Chapter 11: Advanced C# Language Features
- Chapter 12: LINQ to Objects
-
Chapter 13: Understanding Object Lifetime
- Classes, Objects, and References
- The Basics of Object Lifetime
- The Role of Application Roots
- Understanding Object Generations
- Concurrent Garbage Collection Prior to .NET 4.0
- Background Garbage Collection Under .NET 4.0 and Beyond
- The System.GC Type
- Building Finalizable Objects
- Building Disposable Objects
- Building Finalizable and Disposable Types
- Understanding Lazy Object Instantiation
- Summary
-
Chapter 9: Collections and Generics
-
Part V: Programming with .NET Assemblies
-
Chapter 14: Building and Configuring Class Libraries
- Defining Custom Namespaces
- The Role of .NET Assemblies
- Understanding the Format of a .NET Assembly
- Building and Consuming Custom Class Library
- Understanding Private Assemblies
- Understanding Shared Assemblies
- Consuming a Shared Assembly
- Configuring Shared Assemblies
- Understanding Publisher Policy Assemblies
- Understanding the <codeBase> Element
- The System.Configuration Namespace
- The Configuration File Schema Documentation
- Summary
-
Chapter 15: Type Reflection, Late Binding, and Attribute-Based Programming
- The Necessity of Type Metadata
- Understanding Reflection
- Building a Custom Metadata Viewer
- Dynamically Loading Assemblies
- Reflecting on Shared Assemblies
- Understanding Late Binding
- Understanding the Role of .NET Attributes
- Building Custom Attributes
- Assembly-Level Attributes
- Reflecting on Attributes Using Early Binding
- Reflecting on Attributes Using Late Binding
- Putting Reflection, Late Binding, and Custom Attributes in Perspective
- Building an Extendable Application
- Summary
- Chapter 16: Dynamic Types and the Dynamic Language Runtime
- Chapter 17: Processes, AppDomains, and Object Contexts
-
Chapter 18: Understanding CIL and the Role of Dynamic Assemblies
- Motivations for Learning the Grammar of CIL
- Examining CIL Directives, Attributes, and Opcodes
- Pushing and Popping: The Stack-Based Nature of CIL
- Understanding Round-Trip Engineering
- Understanding CIL Directives and Attributes
- .NET Base Class Library, C#, and CIL Data Type Mappings
- Defining Type Members in CIL
- Examining CIL Opcodes
- Building a .NET Assembly with CIL
-
Understanding Dynamic Assemblies
- Exploring the System.Reflection.Emit Namespace
- The Role of the System.Reflection.Emit.ILGenerator
- Emitting a Dynamic Assembly
- Emitting the Assembly and Module Set
- The Role of the ModuleBuilder Type
- Emitting the HelloClass Type and the String Member Variable
- Emitting the Constructors
- Emitting the SayHello() Method
- Using the Dynamically Generated Assembly
- Summary
-
Chapter 14: Building and Configuring Class Libraries
-
Part VI: Introducing the .NET Base Class Libraries
-
Chapter 19: Multithreaded, Parallel, and Async Programming
- The Process/AppDomain/Context/Thread Relationship
- A Brief Review of the .NET Delegate
- The Asynchronous Nature of Delegates
- Invoking a Method Asynchronously
- The System.Threading Namespace
- The System.Threading.Thread Class
- Manually Creating Secondary Threads
- The Issue of Concurrency
- Programming with Timer Callbacks
- Understanding the CLR ThreadPool
- Parallel Programming Using the Task Parallel Library
- Parallel LINQ Queries (PLINQ)
- Asynchronous Calls with the async Keyword
- Summary
-
Chapter 20: File I/O and Object Serialization
- Exploring the System.IO Namespace
- The Directory(Info) and File(Info) Types
- Working with the DirectoryInfo Type
- Working with the Directory Type
- Working with the DriveInfo Class Type
- Working with the FileInfo Class
- Working with the File Type
- The Abstract Stream Class
- Working with StreamWriters and StreamReaders
- Working with StringWriters and StringReaders
- Working with BinaryWriters and BinaryReaders
- Watching Files Programmatically
- Understanding Object Serialization
- Configuring Objects for Serialization
- Choosing a Serialization Formatter
- Serializing Objects Using the BinaryFormatter
- Serializing Objects Using the SoapFormatter
- Serializing Objects Using the XmlSerializer
- Serializing Collections of Objects
- Customizing the Soap/Binary Serialization Process
- Summary
-
Chapter 21: ADO.NET Part I: The Connected Layer
- A High-Level Definition of ADO.NET
- Understanding ADO.NET Data Providers
- Additional ADO.NET Namespaces
- The Types of the System.Data Namespace
- Abstracting Data Providers Using Interfaces
- Creating the AutoLot Database
- The ADO.NET Data Provider Factory Model
- Understanding the Connected Layer of ADO.NET
- Working with Data Readers
- Building a Reusable Data Access Library
- Creating a Console UI–Based Front End
- Understanding Database Transactions
- Summary
-
Chapter 22: ADO.NET Part II: The Disconnected Layer
- Understanding the Disconnected Layer of ADO.NET
- Understanding the Role of the DataSet
- Working with DataColumns
- Working with DataRows
- Working with DataTables
- Binding DataTable Objects to Windows Forms GUIs
- Working with Data Adapters
- Adding Disconnected Functionality to AutoLotDAL.dll
- Multitabled DataSet Objects and Data Relationships
- The Windows Forms Database Designer Tools
- Isolating Strongly Typed Database Code into a Class Library
- Programming with LINQ to DataSet
- Summary
-
Chapter 23: ADO.NET Part III: Entity Framework
- Understanding the Role of the Entity Framework
- Code First from an Existing Database
- Using the Model Classes in Code
- Handling Database Changes
- AutoLotDAL Version 4
- Test-Driving AutoLotDAL
- Entity Framework Migrations
- Revisiting the Transaction Test
- Concurrency
- Interception
- ObjectMaterialized and SavingChanges Events
- Deploying to SQL Server
- Summary
- Chapter 24: Introducing LINQ to XML
-
Chapter 25: Introducing Windows Communication Foundation
- A Potpourri of Distributed Computing APIs
- The Role of WCF
- Investigating the Core WCF Assemblies
- The Visual Studio WCF Project Templates
- The Basic Composition of a WCF Application
- The ABCs of WCF
- Building a WCF Service
- Hosting the WCF Service
- Building the WCF Client Application
- Simplifying Configuration Settings
- Using the WCF Service Library Project Template
- Hosting the WCF Service Within a Windows Service
- Invoking a Service Asynchronously from the Client
- Designing WCF Data Contracts
- Summary
-
Chapter 19: Multithreaded, Parallel, and Async Programming
-
Part VII: Windows Presentation Foundation
-
Chapter 26: Introducing Windows Presentation Foundation and XAML
- The Motivation Behind WPF
- The Various Flavors of WPF
- Investigating the WPF Assemblies
- Building a WPF Application Without XAML
- Building a WPF Application Using Only XAML
- Transforming Markup into a .NET Assembly
- Understanding the Syntax of WPF XAML
- Building a WPF Application Using Code-Behind Files
- Building WPF Applications Using Visual Studio
- Building a Custom XAML Editor with Visual Studio
- Summary
-
Chapter 27: Programming with WPF Controls
- A Survey of the Core WPF Controls
- A Brief Review of the Visual Studio WPF Designer
-
Controlling Content Layout Using Panels
- Positioning Content Within Canvas Panels
- Positioning Content Within WrapPanel Panels
- Positioning Content Within StackPanel Panels
- Positioning Content Within Grid Panels
- Grids with GridSplitter Types
- Positioning Content Within DockPanel Panels
- Enabling Scrolling for Panel Types
- Configuring Panels Using the Visual Studio Designers
- Building a Window’s Frame Using Nested Panels
- Understanding WPF Commands
- Understanding Routed Events
- A Deeper Look at WPF APIs and Controls
- Building the Ink API Tab
- Introducing the Documents API
- Building the Documents Tab
- Introducing the WPF Data-Binding Model
- Understanding the Role of Dependency Properties
- Building a Custom Dependency Property
- Summary
-
Chapter 28: WPF Graphics Rendering Services
- Understanding WPF’s Graphical Rendering Services
- Rendering Graphical Data Using Shapes
- WPF Brushes and Pens
- Applying Graphical Transformations
- Working with the Visual Studio Transform Editor
- Rendering Graphical Data Using Drawings and Geometries
- Working with Vector Images
- Rendering Graphical Data Using the Visual Layer
- Summary
- Chapter 29: WPF Resources, Animations, Styles, and Templates
- Chapter 30: Notifications, Commands, Validation, and MVVM
-
Chapter 26: Introducing Windows Presentation Foundation and XAML
-
Part VIII: ASP.NET
-
Chapter 31: Introducing ASP.NET Web Forms
- The Role of HTTP
- Understanding Web Applications and Web Servers
- The Role of HTML
- The Role of Client-Side Scripting
- Posting Back to the Web Server
- An Overview of the Web Forms API
- Building a Single-File Web Forms Web App
- Building an ASP.NET Web Page Using Code Files
- ASP.NET Web Sites vs. ASP.NET Web Applications
- The ASP.NET Web Site Directory Structure
- The Inheritance Chain of the Page Type
- Interacting with the Incoming HTTP Request
- Interacting with the Outgoing HTTP Response
- The Life Cycle of an ASP.NET Web Page
- The Role of the Web.config File
- Summary
-
Chapter 32: ASP.NET Web Controls, Master Pages, and Themes
- Understanding the Nature of Web Controls
- The Control and WebControl Base Classes
- Major Categories of Web Forms Controls
-
Building the Web Forms Cars Web Site
- Working with Web Forms Master Pages
- Configuring the TreeView Control Site Navigation Logic
- Establishing Breadcrumbs with the SiteMapPath Type
- Configuring the AdRotator Control
- Defining the Default Content Page
- Designing the Inventory Content Page
- Adding AutoLotDAL and Entity Framework to AspNetCarsSite
- Filling the GridView with Data
- Enabling In-Place Editing
- Enabling Sorting and Paging
- Enabling Filtering
- Designing the Build-a-Car Content Page
- The Role of the Validation Controls
- Working with Themes
- Summary
-
Chapter 33: ASP.NET State Management Techniques
- The Issue of State
- ASP.NET State Management Techniques
- Understanding the Role of ASP.NET View State
- The Role of the Global.asax File
- Understanding the Application/Session Distinction
- Working with the Application Cache
- Maintaining Session Data
- Understanding Cookies
- The Role of the <sessionState> Element
- Introducing the ASP.NET Profile API
- Summary
- Chapter 34: ASP.NET MVC and Web API
-
Chapter 31: Introducing ASP.NET Web Forms
- Index
Product information
- Title: C# 6.0 and the .NET 4.6 Framework, Seventh Edition
- Author(s):
- Release date: December 2015
- Publisher(s): Apress
- ISBN: 9781484213322
You might also like
book
Microsoft® .NET Compact Framework (Core Reference)
The Microsoft® Windows® .NET Compact Framework brings the power of the .NET Framework to handheld devices …
book
Pro C# 2010 and the .NET 4 Platform, Fifth Edition
The first edition of this book was released at the 2001 Tech-Ed conference in Atlanta, Georgia. …
book
Microsoft .NET Framework 4.5 Quickstart Cookbook
Over 50 simple but incredibly effective recipes to get updated to exciting new features in .NET …
video
C# 7 and .NET Core 2.0 Recipes
C# is a multi-paradigm programming language providing support for software engineering principles such as strong type …