C# Programming Cookbook
eBook - ePub

C# Programming Cookbook

Dirk Strauss

Condividi libro
  1. 476 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

C# Programming Cookbook

Dirk Strauss

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

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

About This Book

  • Unique recipes for C#, that places it in its real-world context.
  • You will be able to get yourself out of any coding-corner youve backed yourself into.
  • All code samples available through GitHub to bring C#.
  • In line with modern development workflows, written to the latest specification of C# 6.0.

Who This Book Is For

The book is aimed at developers who have basic familiarity with C# programming and will know the VS 2015 environment.

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.

In Detail

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

Style and Approach

Unique recipe-based guide that will help you gain a solid understanding of the new concepts in C# 6 and Visual Studio Enterprise 2015 in a concise and technically correct manner.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
C# Programming Cookbook è disponibile online in formato PDF/ePub?
Sì, puoi accedere a C# Programming Cookbook di Dirk Strauss in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Computer Science e Programming. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2016
ISBN
9781786467300
Edizione
1
Categoria
Programming

C# Programming Cookbook


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...

Indice dei contenuti