Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Clean Code in C#

You're reading from   Clean Code in C# Refactor your legacy C# code base and improve application performance by applying best practices

Arrow left icon
Product type Paperback
Published in Jul 2020
Publisher Packt
ISBN-13 9781838982973
Length 500 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jason Alls Jason Alls
Author Profile Icon Jason Alls
Jason Alls
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Coding Standards and Principles in C# 2. Code Review – Process and Importance FREE CHAPTER 3. Classes, Objects, and Data Structures 4. Writing Clean Functions 5. Exception Handling 6. Unit Testing 7. End-to-End System Testing 8. Threading and Concurrency 9. Designing and Developing APIs 10. Securing APIs with API Keys and Azure Key Vault 11. Addressing Cross-Cutting Concerns 12. Using Tools to Improve Code Quality 13. Refactoring C# Code – Identifying Code Smells 14. Refactoring C# Code – Implementing Design Patterns 15. Assessments 16. Other Books You May Enjoy

To get the most out of this book

The majority of the chapters can be read independently of each other and in any order. But to get the most out of this book, I recommend that you read the chapters in the order presented. As you work through the chapters, follow the instructions, and carry out the tasks presented. Then, when you reach the end of a chapter, answer the questions and carry out the recommended further reading to reinforce what you have learned. For maximum benefit when working through the contents of this book, it is recommended that you meet the following requirements:

Software/hardware covered in the book

Requirements

Visual Studio 2019 Windows 10, macOS
Atom Windows 10, macOS, Linux: https://atom.io/
Azure resources Azure subscription: https://azure.microsoft.com/en-gb/
Azure Key Vault Azure subscription: https://azure.microsoft.com/en-gb/
The Morningstar API Obtain your own API key from https://rapidapi.com/integraatio/api/morningstar1
Postman Windows 10, macOS, Linux: https://www.postman.com/

It will be useful if you have these in place before you start reading and working your way through the chapters.

If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related tothe copying and pasting of code.

You should have basic experience of using Visual Studio 2019 Community Edition or higher, and basic C# programming skills, including writing console applications. Many examples will be in the form of C# console applications. The main project will be using ASP.NET. It will help if you are capable of writing ASP.NET websites using the framework and core. But don't worry – you will be guided through the steps that you need to go through.

Download the example code files

You can download the example code files for this book from your account atwww.packt.com. If you purchased this book elsewhere, you can visitwww.packtpub.com/supportand register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register atwww.packt.com.
  2. Select theSupporttab.
  3. Click onCode Downloads.
  4. Enter the name of the book in theSearchbox and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub athttps://github.com/PacktPublishing/Clean-Code-in-C-. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available athttps://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here:https://static.packt-cdn.com/downloads/9781838982973_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

CodeInText:Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles.Here is an example:"The InMemoryRepository class implements theGetApiKey()method ofIRepository. This returns a dictionary of API keys. These keys will be stored in our_apiKeysdictionary member variable."

A block of code is set as follows:

using CH10_DividendCalendar.Security.Authentication;
using System.Threading.Tasks;

namespace CH10_DividendCalendar.Repository
{
public interface IRepository
{
Task<ApiKey> GetApiKey(string providedApiKey);
}
}

Any command-line input or output is written as follows:

          az group create --name "<YourResourceGroupName>" --location "East US"
        

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "To create the app service, right-click the project you created and select Publish from the menu."

Warnings or important notes appear like this.
Tips and tricks appear like this.
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at R$50/month. Cancel anytime