Book description
When you have a question about C# 5.0 or the .NET CLR, this bestselling guide has precisely the answers you need. Uniquely organized around concepts and use cases, this updated fifth edition features a reorganized section on concurrency, threading, and parallel programming—including in-depth coverage of C# 5.0’s new asynchronous functions.
Table of contents
- C# 5.0 in a Nutshell
- Preface
- 1. Introducing C# and the .NET Framework
-
2. C# Language Basics
- A First C# Program
- Syntax
- Type Basics
- Numeric Types
- Boolean Type and Operators
- Strings and Characters
- Arrays
- Variables and Parameters
- Expressions and Operators
- Statements
- Namespaces
-
3. Creating Types in C#
- Classes
- Inheritance
- The object Type
- Structs
- Access Modifiers
- Interfaces
- Enums
- Nested Types
-
Generics
- Generic Types
- Why Generics Exist
- Generic Methods
- Declaring Type Parameters
- typeof and Unbound Generic Types
- The default Generic Value
- Generic Constraints
- Subclassing Generic Types
- Self-Referencing Generic Declarations
- Static Data
- Type Parameters and Conversions
- Covariance
- Contravariance
- C# Generics Versus C++ Templates
-
4. Advanced C#
- Delegates
- Events
- Lambda Expressions
- Anonymous Methods
- try Statements and Exceptions
- Enumeration and Iterators
- Nullable Types
- Operator Overloading
- Extension Methods
- Anonymous Types
- Dynamic Binding
- Attributes
- Caller Info Attributes (C# 5)
- Unsafe Code and Pointers
- Preprocessor Directives
- XML Documentation
-
5. Framework Overview
-
The CLR and Core Framework
- System Types
- Text Processing
- Collections
- Queries
- XML
- Diagnostics and Code Contracts
- Concurrency and Asynchrony
- Streams and I/O
- Networking
- Serialization
- Assemblies, Reflection, and Attributes
- Dynamic Programming
- Security
- Advanced Threading
- Parallel Programming
- Application Domains
- Native and COM Interoperability
- Applied Technologies
-
The CLR and Core Framework
-
6. Framework Fundamentals
- String and Text Handling
- Dates and Times
- Dates and Time Zones
- Formatting and Parsing
- Standard Format Strings and Parsing Flags
- Other Conversion Mechanisms
- Globalization
- Working with Numbers
- Enums
- Tuples
- The Guid Struct
- Equality Comparison
- Order Comparison
- Utility Classes
- 7. Collections
-
8. LINQ Queries
- Getting Started
- Fluent Syntax
- Query Expressions
- Deferred Execution
- Subqueries
- Composition Strategies
- Projection Strategies
- Interpreted Queries
- LINQ to SQL and Entity Framework
- Building Query Expressions
- 9. LINQ Operators
- 10. LINQ to XML
- 11. Other XML Technologies
- 12. Disposal and Garbage Collection
-
13. Diagnostics and Code Contracts
- Conditional Compilation
- Debug and Trace Classes
- Code Contracts Overview
- Preconditions
- Postconditions
- Assertions and Object Invariants
- Contracts on Interfaces and Abstract Methods
- Dealing with Contract Failure
- Selectively Enforcing Contracts
- Static Contract Checking
- Debugger Integration
- Processes and Process Threads
- StackTrace and StackFrame
- Windows Event Logs
- Performance Counters
- The Stopwatch Class
-
14. Concurrency & Asynchrony
- Introduction
- Threading
- Tasks
- Principles of Asynchrony
- Asynchronous Functions in C# 5.0
- Asynchronous Patterns
- Obsolete Patterns
- 15. Streams and I/O
-
16. Networking
- Network Architecture
- Addresses and Ports
- URIs
- Client-Side Classes
- Working with HTTP
- Writing an HTTP Server
- Using FTP
- Using DNS
- Sending Mail with SmtpClient
- Using TCP
- Receiving POP3 Mail with TCP
- TCP in Windows Runtime
- 17. Serialization
-
18. Assemblies
- What’s in an Assembly
- Strong Names and Assembly Signing
- Assembly Names
- Authenticode Signing
- The Global Assembly Cache
- Resources and Satellite Assemblies
- Resolving and Loading Assemblies
- Deploying Assemblies Outside the Base Folder
- Packing a Single-File Executable
- Working with Unreferenced Assemblies
-
19. Reflection and Metadata
- Reflecting and Activating Types
- Reflecting and Invoking Members
- Reflecting Assemblies
- Working with Attributes
- Dynamic Code Generation
- Emitting Assemblies and Types
- Emitting Type Members
- Emitting Generic Methods and Types
- Awkward Emission Targets
- Parsing IL
- 20. Dynamic Programming
- 21. Security
- 22. Advanced Threading
-
23. Parallel Programming
- Why PFX?
- PLINQ
- The Parallel Class
- Task Parallelism
- Working with AggregateException
- Concurrent Collections
- BlockingCollection<T>
- 24. Application Domains
- 25. Native and COM Interoperability
-
26. Regular Expressions
- Regular Expression Basics
- Quantifiers
- Zero-Width Assertions
- Groups
- Replacing and Splitting Text
-
Cookbook Regular Expressions
-
Recipes
- Matching U.S. Social Security number/phone number
- Extracting “name = value” pairs (one per line)
- Strong password validation
- Lines of at least 80 characters
- Parsing dates/times (N/N/N H:M:S AM/PM)
- Matching Roman numerals
- Removing repeated words
- Word count
- Matching a Guid
- Parsing an XML/HTML tag
- Splitting a camel-cased word
- Obtaining a legal filename
- Escaping Unicode characters for HTML
- Unescaping characters in an HTTP query string
- Parsing Google search terms from a web stats log
-
Recipes
- Regular Expressions Language Reference
- Index
- About the Authors
- Colophon
- Copyright
Product information
- Title: C# 5.0 in a Nutshell, 5th Edition
- Author(s):
- Release date: June 2012
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449320102
You might also like
book
C# 4.0 in a Nutshell, 4th Edition
What people are saying about C# 4.0 in a Nutshell "C# 4.0 in a Nutshell is …
book
C# 3.0 in a Nutshell, 3rd Edition
This is a concise yet thorough reference to C# 3.0 programming as implemented in Microsoft's Visual …
book
C# 6.0 in a Nutshell, 6th Edition
When you have questions about C# 6.0 or the .NET CLR and its core Framework assemblies, …
book
Programming C# 4.0, 6th Edition
With its support for dynamic programming, C# 4.0 continues to evolve as a versatile language on …