O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Essential C# 7.0, Sixth Edition

Book Description

Essential C# 7.0 is a well-organized, no-fluff guide to the latest versions of C# for programmers at all levels of experience. Updated to reflect new C# 7.0 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# 7.0 makes it easy to program with any version of C#, whether you’re creating new code or maintaining existing systems.

Table of Contents

  1. Cover Page
  2. Title Page
  3. Contents at a Glance
  4. Contents
  5. Foreword
  6. Chapter 1 Introducing C#
    1. Hello, World
    2. C# Syntax Fundamentals
    3. Console Input and Output
    4. Managed Execution and the Common Language Infrastructure
    5. Multiple .NET frameworks
    6. Summary
  7. Chapter 2 Data Types
    1. Fundamental Numeric Types
    2. More Fundamental Types
    3. null and void
    4. Conversions between Data Types
    5. Summary
  8. Chapter 3 More with Data Types
    1. Categories of Types
    2. Nullable Modifier
    3. Tuples
    4. Arrays
    5. Summary
  9. Chapter 4 Operators and Control Flow
    1. Operators
    2. Introducing Flow Control
    3. Code Blocks ({})
    4. Code Blocks, Scopes, and Declaration Spaces
    5. Boolean Expressions
    6. Bitwise Operators (<<, >>, |, &, ^, ~)
    7. Control Flow Statements, Continued
    8. Jump Statements
    9. C# Preprocessor Directives
    10. Summary
  10. Chapter 5 Methods and Parameters
    1. Calling a Method
    2. Declaring a Method
    3. The using Directive
    4. Returns and Parameters on Main()
    5. Advanced Method Parameters
    6. Recursion
    7. Method Overloading
    8. Optional Parameters
    9. Basic Error Handling with Exceptions
    10. Summary
  11. Chapter 6 Classes
    1. Declaring and Instantiating a Class
    2. Instance Fields
    3. Instance Methods
    4. Using the this Keyword
    5. Access Modifiers
    6. Properties
    7. Constructors
    8. Static Members
    9. Extension Methods
    10. Encapsulating the Data
    11. Nested Classes
    12. Partial Classes
    13. Summary
  12. Chapter 7 Inheritance
    1. Derivation
    2. Overriding the Base Class
    3. Abstract Classes
    4. All Classes Derive from System.Object
    5. Verifying the Underlying Type with the is Operator
    6. Pattern Matching with the is Operator
    7. Pattern Matching with in a Switch Statement
    8. Conversion Using the as Operator
    9. Summary
  13. Chapter 8 Interfaces
    1. Introducing Interfaces
    2. Polymorphism through Interfaces
    3. Interface Implementation
    4. Converting between the Implementing Class and Its Interfaces
    5. Interface Inheritance
    6. Multiple Interface Inheritance
    7. Extension Methods on Interfaces
    8. Implementing Multiple Inheritance via Interfaces
    9. Versioning
    10. Interfaces Compared with Classes
    11. Interfaces Compared with Attributes
    12. Summary
  14. Chapter 9 Value Types
    1. Structs
    2. Boxing
    3. Enums
    4. Summary
  15. Chapter 10 Well-Formed Types
    1. Overriding object Members
    2. Operator Overloading
    3. Referencing Other Assemblies
    4. Defining Namespaces
    5. XML Comments
    6. Garbage Collection
    7. Resource Cleanup
    8. Lazy Initialization
    9. Summary
  16. Chapter 11 Exception Handling
    1. Multiple Exception Types
    2. Catching Exceptions
    3. General Catch Block
    4. Guidelines for Exception Handling
    5. Defining Custom Exceptions
    6. Rethrowing a Wrapped Exception
    7. Summary
  17. Chapter 12 Generics
    1. C# without Generics
    2. Introducing Generic Types
    3. Constraints
    4. Generic Methods
    5. Covariance and Contravariance
    6. Generic Internals
    7. Summary
  18. Chapter 13 Delegates and Lambda Expressions
    1. Introducing Delegates
    2. Declaring Delegate Types
    3. Lambda Expressions
    4. Anonymous Methods
    5. Summary
  19. Chapter 14 Events
    1. Coding the Publish-Subscribe Pattern with Multicast Delegates
    2. Understanding Events
    3. Summary
  20. Chapter 15 Collection Interfaces with Standard Query Operators
    1. Collection Initializers
    2. What Makes a Class a Collection: IEnumerable<T>
    3. Standard Query Operators
    4. Anonymous Types with LINQ
    5. Summary
  21. Chapter 16 LINQ with Query Expressions
    1. Introducing Query Expressions
    2. Query Expressions Are Just Method Invocations
    3. Summary
  22. Chapter 17 Building Custom Collections
    1. More Collection Interfaces
    2. Primary Collection Classes
    3. Providing an Indexer
    4. Returning Null or an Empty Collection
    5. Iterators
    6. Summary
  23. Chapter 18 Reflection, Attributes, and Dynamic Programming
    1. Reflection
    2. nameof Operator
    3. Attributes
    4. Programming with Dynamic Objects
    5. Summary
  24. Chapter 19 Multithreading
    1. Multithreading Basics
    2. Working with System.Threading
    3. Asynchronous Tasks
    4. Canceling a Task
    5. The Task-Based Asynchronous Pattern
    6. Executing Loop Iterations in Parallel
    7. Running LINQ Queries in Parallel
    8. Summary
  25. Chapter 20 Thread Synchronization
    1. Why Synchronization?
    2. Timers
    3. Summary
  26. Chapter 21 Platform Interoperability and Unsafe Code
    1. Platform Invoke
    2. Pointers and Addresses
    3. Executing Unsafe Code via a Delegate
    4. Summary
  27. Chapter 22 The Common Language Infrastructure
    1. Defining the Common Language Infrastructure
    2. CLI Implementations
    3. .NET Standard
    4. Base Class Library
    5. C# Compilation to Machine Code
    6. Runtime
    7. Assemblies, Manifests, and Modules
    8. Common Intermediate Language
    9. Common Type System
    10. Common Language Specification
    11. Metadata
    12. .NET Native and Ahead of Time (AOT) Compilation
    13. Summary