Book description
“ Welcome to one of the greatest collaborations you could dream of in the world of C# books—and probably far beyond!”
—From the Foreword by Mads Torgersen, C# Program Manager, Microsoft
Essential C# 6.0 is a well-organized, no-fluff guide to the latest versions of C# for programmers at all levels of experience. Fully updated to reflect new C# 6.0 and .NET 4.6 features and patterns, it will help you write C# code that’s simple, powerful, robust, secure, and maintainable.
This book’s authors are world-class C# experts: long-time Microsoft MVP and Regional Director Mark Michaelis and Eric Lippert, formerly principal developer on Microsoft’s C# compiler team. Together, they cover the entire language, illustrating key constructs with succinct examples and offering a complete foundation for successful C# development.
Essential C# 6.0 makes it easy to program with any version of C#, whether you’re creating new code or maintaining existing systems. Separate indexes for C# versions 4, 5, and 6 help you quickly find version-specific answers with accompanying visual indicators that help you identify which language innovations will work when. This edition also includes a set of best-practice C# Coding Guidelines updated to leverage C# 6.0 constructs.
Coverage includes
Mastering C# data types, operators, control flow, methods, and parameters
Using C# object-oriented constructs, including classes, inheritance, interfaces, and more—all with the significantly simplified syntax of C# 6.0
Working with well-formed value and reference types
Implementing reliable, effective exception handling
Reducing code complexity with generics, delegates, lambda expressions, and events (including a simplified C# 6.0 syntax for triggering events)
Learning dynamic programming with reflection and attributes
Querying diverse data collections using LINQ with query expressions
Creating custom collections that operate against business objects
Using collection interfaces and standard query operators to access .NET collections
Understanding the Common Language Infrastructure and C# in the context of .NET 4.6
Taking advantage of declarative programming, embedded metadata, reflection, and attributes
Mastering multithreading and synchronization, including the new async/await paradigm
Using P/Invoke, pointers, and direct memory manipulation to interoperate with other languages
Understanding how C# programs relate to the underlying runtime
For Qualified Instructors
An instructor’s guide, exercises, and a slide deck are available to support your courses.
Table of contents
- About This eBook
- Title Page
- Copyright Page
- Dedication Page
- Contents at a Glance
- Contents
- Figures
- Tables
- Foreword
- Preface
- Acknowledgments
- About the Authors
- 1. Introducing C#
- 2. Data Types
- 3. Operators and Control Flow
- 4. Methods and Parameters
- 5. Classes
- 6. Inheritance
-
7. Interfaces
- Introducing Interfaces
- Polymorphism through Interfaces
- Interface Implementation
- Converting between the Implementing Class and Its Interfaces
- Interface Inheritance
- Multiple Interface Inheritance
- Extension Methods on Interfaces
- Implementing Multiple Inheritance via Interfaces
- Versioning
- Interfaces Compared with Classes
- Interfaces Compared with Attributes
- Summary
- 8. Value Types
-
9. Well-Formed Types
- Overriding object Members
-
Operator Overloading
- Comparison Operators (==, !=, <, >, <=, >=)
- Binary Operators (+, -, *, /, %, &, |, ^, <<, >>)
- Combining Assignment with Binary Operators (+=, -=, *=, /=, %=, &=, ...)
- Conditional Logical Operators (&&, ||)
- Unary Operators (+, -, !, ~, ++, --, true, false)
- Conversion Operators
- Guidelines for Conversion Operators
- Referencing Other Assemblies
- Defining Namespaces
- XML Comments
- Garbage Collection
- Resource Cleanup
- Lazy Initialization
- Summary
- 10. Exception Handling
- 11. Generics
- 12. Delegates and Lambda Expressions
- 13. Events
-
14. Collection Interfaces with Standard Query Operators
- Anonymous Types and Implicitly Typed Local Variables
- Collection Initializers
- What Makes a Class a Collection: IEnumerable<T>
-
Standard Query Operators
- Filtering with Where()
- Projecting with Select()
- Counting Elements with Count()
- Deferred Execution
- Sorting with OrderBy() and ThenBy()
- Performing an Inner Join with Join()
- Grouping Results with GroupBy()
- Implementing a One-to-Many Relationship with GroupJoin()
- Calling SelectMany()
- More Standard Query Operators
- Summary
- 15. LINQ with Query Expressions
- 16. Building Custom Collections
- 17. Reflection, Attributes, and Dynamic Programming
- 18. Multithreading
-
19. Thread Synchronization
-
Why Synchronization?
- Synchronization Using Monitor
- Using the lock Keyword
- Choosing a lock Object
- Why to Avoid Locking on this, typeof(type), and string
- Declaring Fields As volatile
- Using the System.Threading.Interlocked Class
- Event Notification with Multiple Threads
- Synchronization Design Best Practices
- More Synchronization Types
- Thread Local Storage
- Timers
- Summary
-
Why Synchronization?
- 20. Platform Interoperability and Unsafe Code
- 21. The Common Language Infrastructure
- A. Downloading and Installing the C# Compiler and CLI Platform
- B. Tic-Tac-Toe Source Code Listing
- Index
- Index of 6.0 Topics
- Index of 5.0 Topics
- Index of 4.0 Topics
- Index of 3.0 Topics
- C. Interfacing with Multithreading Patterns prior to the TPL and C# 6.0
- D. Timers Prior to the Async/Await Pattern of C# 5.0
Product information
- Title: Essential C# 6.0
- Author(s):
- Release date: September 2015
- Publisher(s): Addison-Wesley Professional
- ISBN: 9780134176147
You might also like
book
Professional C# 5.0 and .NET 4.5.1
Comprehensive, advanced coverage of C# 5.0 and .NET 4.5.1 Whether you're a C# guru or transitioning …
book
MCTS Self-Paced Training Kit (Exam 70-643): Configuring Windows Server® 2008 Applications Infrastructure
EXAM PREP GUIDE Fully updated for Windows Server 2008 R2! Ace your preparation for the skills …
book
Microsoft® Windows Server™ 2003 Inside Out
Designed for system administrators, this definitive, supremely organized reference delivers in-depth solutions, tips, and tools for …
book
Windows® 7 Resource Kit
In-depth and comprehensive, this official RESOURCE KIT delivers the information you need to administer Windows 7 …