C# Programming Cookbook

Quick fixes to your common C# programming problems, with a focus on C# 6.0

C# Programming Cookbook

Cookbook
Dirk Strauss

5 customer reviews
Quick fixes to your common C# programming problems, with a focus on C# 6.0
$39.99
$49.99
RRP $39.99
RRP $49.99
eBook
Print + eBook

Instantly access this course right now and get the skills you need in 2017

With unlimited access to a constantly growing library of over 4,000 eBooks and Videos, a subscription to Mapt gives you everything you need to learn new skills. Cancel anytime.

Free Sample

Book Details

ISBN 139781786467300
Paperback476 pages

Book Description

During your application development workflow, there is always a moment when you need to get out of a tight spot. Through a recipe-based approach, this book will help you overcome common programming problems and get your applications ready to face the modern world.

We start with C# 6, giving you hands-on experience with the new language features. Next, we work through the tasks that you perform on a daily basis such as working with strings, generics, and lots more. Gradually, we move on to more advanced topics such as the concept of object-oriented programming, asynchronous programming, reactive extensions, and code contracts.

You will learn responsive high performance programming in C# and how to create applications with Azure. Next, we will review the choices available when choosing a source control solution. At the end of the book, we will show you how to create secure and robust code, and will help you ramp up your skills when using the new version of C# 6 and Visual Studio

Table of Contents

Chapter 1: New Features in C# 6.0
Introduction
Creating your Visual Studio project
String interpolation
Null-conditional operator
Initializers for auto-implemented properties and getter-only auto properties
Index initializers
The nameof expressions
Expression-bodied functions and properties
Using static
Exception filters
Using await operator in catch and finally blocks
Chapter 2: Classes and Generics
Introduction
Creating and implementing an abstract class
Creating and implementing an interface
Creating and using a generic class or method
Creating and using a generic interface
Chapter 3: Object-Oriented Programming in C#
Introduction
Using inheritance in C#
Using abstraction
Leveraging encapsulation
Implementing polymorphism
Single responsibility principle
Open/closed principle
Chapter 4: Composing Event-Based Programs Using Reactive Extensions
Introduction
Installing Rx
Events versus observables
Using LINQ to perform queries
Using schedulers in Rx
Debugging lambda expressions
Chapter 5: Create Microservices on Azure Service Fabric
Introduction
Downloading and installing Service Fabric
Creating a Service Fabric application with a stateless actor service
Using Service Fabric Explorer
Chapter 6: Making Apps Responsive with Asynchronous Programming
Introduction
Return types of asynchronous functions
Handling tasks in asynchronous programming
Exception handling in asynchronous programming
Chapter 7: High Performance Programming Using Parallel and Multithreading in C#
Introduction
Creating and aborting a low-priority background thread
Increasing maximum thread pool size
Creating multiple threads
Locking one thread until the contended resources are available
Invoking parallel calls to methods using Parallel.Invoke
Using a parallel foreach loop to run multiple threads
Cancelling a parallel foreach loop
Catching errors in parallel foreach loops
Debugging multiple threads
Chapter 8: Code Contracts
Introduction
Downloading, installing, and integrating code contracts into Visual Studio
Creating code contract preconditions
Creating code contract postconditions
Creating code contract invariant
Creating code contract Assert and Assume methods
Creating code contract ForAll method
Creating code contract ValueAtReturn method
Creating code contract Result method
Using code contracts on abstract classes
Using contract abbreviator methods
Creating tests using IntelliTest
Using code contracts in extension methods
Chapter 9: Regular Expressions
Introduction
Getting started with regex
Matching a valid date
Sanitizing input
Dynamic regex matching
Chapter 10: Choosing and Using a Source Control Strategy
Introduction
Setting up Visual Studio account management and determining which source control solution is best for you
Setting up Visual Studio GitHub integration, checking in code for the first time, and checking in changes
Working as a team using GitHub, and handling and resolving conflicts in code
Chapter 11: Creating a Mobile Application in Visual Studio
Introduction
Installing Xamarin and other required components
Creating an Android Visual Studio project using Apache Cordova
Creating an iOS application using Xamarin Forms
Chapter 12: Writing Secure Code and Debugging in Visual Studio
Introduction
Encrypting and storing passwords correctly
Using SecureString in code
Securing sensitive parts of App.config/web.config
Preventing SQL injection attacks
Using Diagnostic Tools and Historical Debugging
Setting conditional breakpoints
Using PerfTips to identify bottlenecks in code
Chapter 13: Creating a Web Application in Azure
Introduction
Creating a database in Azure for testing
Creating a web application and hosting on Azure
Using virtual machines on Azure

What You Will Learn

  • Write better and less code to achieve the same result as in previous versions of C#.
  • Generate tests from the Code Contracts for mission critical methods.
  • Integrate code in Visual Studio with GitHub.
  • Create a web application in Azure.
  • Design and build a microservice architecture
  • Demystify the Rx library using Reactive extensions
  • Write high performing codes in C# and understanding multi-threading.
  • Security and Debugging.
  • Implement Code Contracts on code in Visual Studio.

Authors

Table of Contents

Chapter 1: New Features in C# 6.0
Introduction
Creating your Visual Studio project
String interpolation
Null-conditional operator
Initializers for auto-implemented properties and getter-only auto properties
Index initializers
The nameof expressions
Expression-bodied functions and properties
Using static
Exception filters
Using await operator in catch and finally blocks
Chapter 2: Classes and Generics
Introduction
Creating and implementing an abstract class
Creating and implementing an interface
Creating and using a generic class or method
Creating and using a generic interface
Chapter 3: Object-Oriented Programming in C#
Introduction
Using inheritance in C#
Using abstraction
Leveraging encapsulation
Implementing polymorphism
Single responsibility principle
Open/closed principle
Chapter 4: Composing Event-Based Programs Using Reactive Extensions
Introduction
Installing Rx
Events versus observables
Using LINQ to perform queries
Using schedulers in Rx
Debugging lambda expressions
Chapter 5: Create Microservices on Azure Service Fabric
Introduction
Downloading and installing Service Fabric
Creating a Service Fabric application with a stateless actor service
Using Service Fabric Explorer
Chapter 6: Making Apps Responsive with Asynchronous Programming
Introduction
Return types of asynchronous functions
Handling tasks in asynchronous programming
Exception handling in asynchronous programming
Chapter 7: High Performance Programming Using Parallel and Multithreading in C#
Introduction
Creating and aborting a low-priority background thread
Increasing maximum thread pool size
Creating multiple threads
Locking one thread until the contended resources are available
Invoking parallel calls to methods using Parallel.Invoke
Using a parallel foreach loop to run multiple threads
Cancelling a parallel foreach loop
Catching errors in parallel foreach loops
Debugging multiple threads
Chapter 8: Code Contracts
Introduction
Downloading, installing, and integrating code contracts into Visual Studio
Creating code contract preconditions
Creating code contract postconditions
Creating code contract invariant
Creating code contract Assert and Assume methods
Creating code contract ForAll method
Creating code contract ValueAtReturn method
Creating code contract Result method
Using code contracts on abstract classes
Using contract abbreviator methods
Creating tests using IntelliTest
Using code contracts in extension methods
Chapter 9: Regular Expressions
Introduction
Getting started with regex
Matching a valid date
Sanitizing input
Dynamic regex matching
Chapter 10: Choosing and Using a Source Control Strategy
Introduction
Setting up Visual Studio account management and determining which source control solution is best for you
Setting up Visual Studio GitHub integration, checking in code for the first time, and checking in changes
Working as a team using GitHub, and handling and resolving conflicts in code
Chapter 11: Creating a Mobile Application in Visual Studio
Introduction
Installing Xamarin and other required components
Creating an Android Visual Studio project using Apache Cordova
Creating an iOS application using Xamarin Forms
Chapter 12: Writing Secure Code and Debugging in Visual Studio
Introduction
Encrypting and storing passwords correctly
Using SecureString in code
Securing sensitive parts of App.config/web.config
Preventing SQL injection attacks
Using Diagnostic Tools and Historical Debugging
Setting conditional breakpoints
Using PerfTips to identify bottlenecks in code
Chapter 13: Creating a Web Application in Azure
Introduction
Creating a database in Azure for testing
Creating a web application and hosting on Azure
Using virtual machines on Azure

Book Details

ISBN 139781786467300
Paperback476 pages
Read More
From 5 reviews

Read More Reviews