Enterprise Application Development with C# 9 and .NET 5

Enterprise Application Development with C# 9 and .NET 5

Read it now on the O’Reilly learning platform with a 10-day free trial.

O’Reilly members get unlimited access to books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.

Book description

Become a professional .NET developer by learning expert techniques for building enterprise-grade applications

Key Features

Book Description

.NET Core is one of the most popular programming platforms in the world for an increasingly large community of developers thanks to its excellent cross-platform support. This book will show you how to confidently use the features of .NET 5 with C# 9 to build robust enterprise applications.

Throughout the book, you'll work on creating an enterprise app and adding a key component to the app with each chapter, before finally getting it ready for testing and deployment. You'll learn concepts relating to advanced data structures, the Entity Framework Core, parallel programming, and dependency injection. As you progress, you'll cover various authentication and authorization schemes provided by .NET Core to make your apps and APIs secure. Next, you'll build web apps using ASP.NET Core 5 and deploy them on the cloud while working with various cloud components using Azure. The book then shows you how to use the latest Microsoft Visual Studio 2019 and C# 9 to simplify developer tasks, and also explores tips and tricks in Visual Studio 2019 to improve your productivity. Later, you'll discover various testing techniques such as unit testing and performance testing as well as different methods to deploy enterprise apps.

By the end of this book, you'll be able to create enterprise apps using the powerful features of .NET 5 and deploy them on the cloud.

What you will learn

Who this book is for

If you are a developer, architect, or senior programmer who wants to leverage the features of .NET 5 and the C# language, as well as grasp essential techniques to build your skills, then this C# .NET 5 book is for you. Beginner to intermediate-level knowledge of the .NET framework and C# programming is required to understand the concepts covered in this book more effectively.

Show and hide more Table of contents Product information

Table of contents

  1. Enterprise Application Development with C# 9 and .NET 5
  2. Contributors
  3. About the authors
  4. About the reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Reviews
    1. Technical requirements
    2. A primer on common design principles and patterns
      1. Design principles
      2. Design patterns
      1. Common issues with monolithic apps
      2. Separation of concerns/single responsibility architecture
      3. Domain-driven architecture
      4. Stateless services architecture
      5. Event-driven architecture
      6. Data storage and access architecture
      7. Resiliency architecture
      8. Evolution and operations architecture
      1. The application's business requirements
      2. The application's technical requirements
      1. Technical requirements
      2. Introducing .NET 5
        1. Understanding the core features
        2. Understanding application frameworks
        1. Overview of global.json
        1. Understanding the use of .NET 5 and .NET Standard
        1. Cloud support
        1. Technical requirements
        2. Understanding Init-only setters
        3. Working with record types
          1. The with expression
          1. The constant pattern
          2. Type patterns
          3. Property patterns
          4. Conjunctive and disjunctive patterns
          5. Pattern matching with the switch expression
          6. Tuple patterns
          1. Technical requirements
          2. Understanding the jargon
          3. Demystifying threads, lazy initialization, and ThreadPool
            1. Working with System.Threading.Thread
            2. ThreadPool
            3. Lazy initialization
            1. The critical section and thread safety
            2. Introducing locks
            3. Mutex (Windows only)
            4. Introducing semaphores and SemaphoreSlim
            5. Choosing the right synchronization constructs
            1. Introduction to Task and the TPL
            2. Handling task exceptions
            3. Implementing task cancellation
            4. Implementing continuations
            5. SynchronizationContext
            6. TaskScheduler
            7. Implementing data parallelism
            8. Using Parallel LINQ (PLINQ)
            1. The task-based asynchronous pattern
            2. Principles of using async-await
            3. Async streams with IAsyncEnumerable
            4. Wrappers for legacy patterns
            5. ThreadPool starvation
            1. ConcurrentDictionary
            2. Producer-consumer concurrent collections
            3. The BlockingCollection class
            1. Technical requirements
            2. What is DI?
              1. Types of DI
              1. Understanding service lifetimes
              2. Managing application services
              3. DI in Razor Pages
              1. Technical requirements
              2. Understanding configuration
                1. Default configuration
                2. Adding configurations
                3. Reading configurations
                1. Azure Key Vault configuration provider
                2. File configuration provider
                1. Configuration source
                2. Configuration provider
                3. Configuration extension
                1. Technical requirements
                2. Characteristics of good logging
                3. Understanding the available logging providers
                  1. Built-in logging providers
                  2. Third-party logging providers
                  1. Enabling application logging in Azure App Service
                  2. Monitoring using metrics
                  3. Alerting using metrics
                  1. Enabling application logging in Application Insights
                  1. Technical requirements
                  2. Introduction to caching
                    1. Client caching
                    2. Content Delivery Network (CDN)
                    3. Web server caching
                    4. Database caching
                    5. Application caching
                    1. Response caching
                    2. Distributed caching
                    3. Cache access patterns
                    1. In-memory cache
                    2. Distributed cache
                    1. Caching considerations
                    1. Technical requirements
                    2. Introduction to data
                      1. Relational Database Management System (RDBMS)
                      2. NoSQL
                      1. Handling directories
                      2. Reading/writing data with streams, binary, and strings
                      3. Streams
                      4. Reader/writer
                      5. TextReader/TextWriter versus BinaryReader/BinaryWriter
                      6. JSON.NET
                      1. SQL Server
                      2. Azure Cosmos DB
                      3. Azure Storage
                      1. Configuration and querying
                      2. Code first versus database first
                      1. Technical requirements
                      2. Introduction to Representational State Transfer (REST)
                        1. The REST maturity model
                        1. Program and Startup classes
                        2. Understanding middleware
                        3. Building a custom middleware
                        1. Understanding ASP.NET Core routing
                        2. Attribute-based routing
                        3. The ControllerBase class, the ApiController attribute, and the ActionResult class
                        1. Creating DTOs
                        2. Service class contracts
                        3. The mapper class using AutoMapper
                        4. HttpClient factory for service-to-service calls
                        5. Implementing service classes
                        6. Implementing action methods in the controller
                        1. Building a gRPC server in .NET
                        2. Building a gRPC client in .NET
                        3. Testing gRPC services
                        1. Technical requirements
                        2. Introduction to frontend web development
                          1. Razor syntax
                          2. Exploring Razor Pages
                          3. Exploring the ASP.NET Core MVC website
                          4. Understanding single-page applications
                          1. Setting up AdminLTE, the Layout page, and views
                          1. Technical requirements
                          2. Understanding the elements of authentication in .NET 5
                          3. Introduction to ASP.NET Core Identity
                            1. Sample implementation
                            2. Scaffolding
                            3. Integration with external login providers
                            1. Tokens
                            2. Authorization grant types
                            1. Azure AD B2C setup
                            2. Integration of our e-commerce application to Azure AD B2C
                            1. Technical requirements
                            2. Back to a few basics
                            3. Understanding authorization
                              1. Simple authorization
                              2. Enabling authorization globally
                              1. Policy-based role authorization
                              2. Implementing role-based authorization
                              1. Requirements
                              2. Requirement handlers
                              3. Registering a policy
                              1. Custom authorization attributes
                              1. Assigning roles to users
                              2. User identity in views
                              1. Technical requirements
                              2. Introducing health checks
                              3. The health check API in ASP.NET Core 5
                                1. Adding a health check endpoint
                                2. Monitoring dependent URIs
                                3. Building a custom health check
                                1. Live Metrics
                                2. Usage analysis with Application Insights
                                3. Smart Detection
                                4. Application availability
                                5. Search
                                6. Logs
                                7. Snapshot Debugger
                                1. Technical requirements
                                2. Introducing testing
                                3. Understanding unit testing
                                  1. Unit testing in Visual Studio
                                  2. Code coverage
                                  1. Automating functional test cases
                                  1. Load testing with JMeter
                                  1. Technical requirements
                                  2. Introducing Azure DevOps
                                    1. Boards
                                    2. Repos
                                    3. Pipelines
                                    4. Test plans
                                    5. Artifacts
                                    1. Understanding the flow and components of a pipeline
                                    1. Continuous deployment versus continuous delivery
                                    1. Creating a pipeline for CI and CD
                                    1. Chapter 1
                                    2. Chapter 2
                                    3. Chapter 3
                                    4. Chapter 4
                                    5. Chapter 5
                                    6. Chapter 6
                                    7. Chapter 7
                                    8. Chapter 8
                                    9. Chapter 9
                                    10. Chapter 10
                                    11. Chapter 11
                                    12. Chapter 12
                                    13. Chapter 13
                                    14. Chapter 14
                                    15. Chapter 15
                                    16. Chapter 16
                                    17. Why subscribe?
                                    1. Packt is searching for authors like you
                                    2. Leave a review - let other readers know what you think
                                    Show and hide more

                                    Product information

                                    • Title: Enterprise Application Development with C# 9 and .NET 5
                                    • Author(s): Ravindra Akella, Arun Kumar Tamirisa, Suneel Kumar Kunani, Bhupesh Guptha Muthiyalu
                                    • Release date: March 2021
                                    • Publisher(s): Packt Publishing
                                    • ISBN: 9781800209442