![]()
Table of Contents
C# Programming Cookbook
Credits
About the Author
Acknowledgements
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why Subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do itā¦
How it worksā¦
There's moreā¦
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. New Features in C# 6.0
Introduction
Creating your Visual Studio project
Getting ready
How to do itā¦
How it worksā¦
String interpolation
Getting ready
How to do itā¦
How it worksā¦
Null-conditional operator
Getting ready
How to do itā¦
How it worksā¦
Initializers for auto-implemented properties and getter-only auto properties
Getting ready
How to do itā¦
How it worksā¦
Index initializers
Getting ready
How to do itā¦
How it worksā¦
The nameof expressions
Getting ready
How to do itā¦
How it worksā¦
Expression-bodied functions and properties
Getting ready
How to do itā¦
How it worksā¦
Using static
Getting ready
How to do itā¦
How it worksā¦
Exception filters
Getting ready
How to do itā¦
How it worksā¦
Using await operator in catch and finally blocks
Getting ready
How to do itā¦
How it worksā¦
2. Classes and Generics
Introduction
Creating and implementing an abstract class
Getting ready
How to do itā¦
How it worksā¦
Creating and implementing an interface
Getting ready
How to do itā¦
How it worksā¦
Creating and using a generic class or method
Getting ready
How to do itā¦
How it worksā¦
Creating and using a generic interface
Getting ready
How to do itā¦
How it worksā¦
3. Object-Oriented Programming in C#
Introduction
Using inheritance in C#
Getting ready
How to do itā¦
How it worksā¦
Using abstraction
Getting ready
How to do itā¦
How it worksā¦
Leveraging encapsulation
Getting ready
How to do itā¦
How it worksā¦
Implementing polymorphism
Getting ready
How to do itā¦
How it worksā¦
Single responsibility principle
Getting ready
How to do itā¦
How it worksā¦
Open/closed principle
Getting ready
How to do itā¦
How it worksā¦
4. Composing Event-Based Programs Using Reactive Extensions
Introduction
Installing Rx
Getting ready
How to do itā¦
How it worksā¦
Events versus observables
Getting ready
How to do itā¦
How it worksā¦
Using LINQ to perform queries
Getting ready
How to do itā¦
How it worksā¦
Using schedulers in Rx
Getting ready
How to do itā¦
How it worksā¦
Debugging lambda expressions
Getting ready
How to do itā¦
How it worksā¦
5. Create Microservices on Azure Service Fabric
Introduction
Downloading and installing Service Fabric
Getting ready
How to do itā¦
How it worksā¦
Creating a Service Fabric application with a stateless actor service
Getting ready
How to do itā¦
How it worksā¦
Using Service Fabric Explorer
Getting ready
How to do itā¦
How it worksā¦
6. Making Apps Responsive with Asynchronous Programming
Introduction
Return types of asynchronous functions
Getting ready
How to do itā¦
How it worksā¦
Handling tasks in asynchronous programming
Getting ready
How to do itā¦
How it worksā¦
Exception handling in asynchronous programming
Getting ready
How to do itā¦
How it worksā¦
7. High Performance Programming Using Parallel and Multithreading in C#
Introduction
Creating and aborting a low-priority background thread
Getting ready
How to do itā¦
How it worksā¦
Increasing maximum thread pool size
Getting ready
How to do itā¦
How it worksā¦
Creating multiple threads
Getting ready
How to do itā¦
How it worksā¦
Locking one thread until the contended resources are available
Getting ready
How to do itā¦
How it worksā¦
Invoking parallel calls to methods using Parallel.Invoke
Getting ready
How to do itā¦
How it worksā¦
Using a parallel foreach loop to run multiple threads
Getting ready
How to do itā¦
How it worksā¦
Cancelling a parallel foreach loop
Getting ready
How to do itā¦
How it worksā¦
Catching errors in parallel foreach loops
Getting ready
How to do itā¦
How it worksā¦
Debugging multiple threads
Getting ready
How to do itā¦
How it worksā¦
8. Code Contracts
Introduction
Downloading, installing, and integrating code contracts into Visual Studio
Getting ready
How to do itā¦
How it worksā¦
Creating code contract preconditions
Getting ready
How to do itā¦
How it worksā¦
Creating code contract postconditions
Getting ready
How to do itā¦
How it worksā¦
Creating code contract invariant
Getting ready
How to do itā¦
How it worksā¦
Creating code contract Assert and Assume methods
Getting ready
How to do itā¦
How it worksā¦
Creating code contract ForAll method
Getting ready
How to do itā¦
How it worksā¦
Creating code contract ValueAtReturn...