Book Image

Enterprise Application Development with C# 9 and .NET 5

By : Rishabh Verma, Ravindra Akella, Arun Kumar Tamirisa, Suneel Kumar Kunani, Bhupesh Guptha Muthiyalu
Book Image

Enterprise Application Development with C# 9 and .NET 5

By: Rishabh Verma, Ravindra Akella, Arun Kumar Tamirisa, Suneel Kumar Kunani, Bhupesh Guptha Muthiyalu

Overview of this book

.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 ?nally 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 di?erent 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.
Table of Contents (24 chapters)
1
Section 1: Architecting an Enterprise Application and its Fundamentals
5
Section 2: Cross-Cutting Concerns
11
Section 3: Developing Your Enterprise Application
15
Section 4: Security
18
Section 5: Health Checks, Unit Testing, Deployment, and Diagnostics

Identifying enterprise application requirements (business and technical)

In the next few chapters, we will build a working e-commerce application. It will be a three-tier application consisting of a UI layer, a service layer, and a database. Let's look at the requirements for this e-commerce application.

The solution requirements are the capabilities to be implemented and made available in the product to solve a problem or achieve an objective.

The business requirements are simply the end customer's needs. In the IT world, "business" generally refers to "customers." These requirements are collected from various stakeholders and documented as a single source of truth for everyone's reference. This eventually becomes the backlog and scope of work to be completed.

The technical requirements are the technology aspects that a system should implement, such as reliability, availability, performance, and BCDR. These are also known as quality of service (QOS) requirements.

Let's break the typical business requirements for an e-commerce application site down into the following categories: Epic, Feature, and User Story.

The application's business requirements

The following screenshot from Azure DevOps shows a summary of the backlog for our business requirements. You can see the different features expected in our application along with the user stories:

Figure 1.12 – Requirements backlog from Azure DevOps

Figure 1.12 – Requirements backlog from Azure DevOps

The application's technical requirements

Having seen the business requirements, let's now go through the technical requirements:

  • The e-commerce application should be highly available, that is, available for 99.99% of the time for any 24-hour period.
  • The e-commerce application should be highly reliable, that is, reliable 99.99% of the time for any 24-hour period.
  • The e-commerce application should be highly performant: 95% of the operations should take less than or equal to 3 seconds.
  • The e-commerce application should be highly scalable: it should automatically scale up/down based on the varying load.
  • The e-commerce application should have monitoring and alerts: an alert should be sent to a support engineer in the case of any system failure.

Here are the technical aspects identified for the e-commerce application and its requirements:

Frontend

  • A web application (e-commerce) using ASP.NET 5.0

Core components

  • Logging/caching/configuration in C# 9.0 and .NET 5.0

Middle tier

  • An Azure API gateway to implement authentication
  • A user management service through an ASP.NET 5.0 web API to add/remove users
  • Product and pricing services through an ASP.NET 5.0 web API to get products from the data store
  • A domain data service through an ASP.NET 5.0 web API to get the domain data, such as country data.
  • A payment service through an ASP.NET 5.0 web API to complete payments
  • An order processing service through an ASP.NET 5.0 web API to submit and search orders
  • An invoice processing service through an ASP.NET 5.0 web API to generate invoices
  • A notification service through an ASP.NET 5.0 web API to send notifications such as emails

Data tier

  • A data access service through an ASP.NET 5.0 web API to talk to Azure Cosmos DB to read/write data
  • Entity Framework Core to access data

Azure Stack

  • Azure Cosmos DB as a backend data store
  • Azure Service Bus for asynchronous message processing
  • Azure App Service to host the web application and web APIs
  • Azure Traffic Manager for high availability and responsiveness
  • Azure Application Insights for diagnostics and telemetry
  • Azure paired regions for better resiliency
  • Azure resource groups to create Azure Resource Manager (ARM) templates and deploy to the Azure subscription
  • Azure Pipelines for continuous integration and continuous deployment (CI/CD)

We are now done with the enterprise application requirements. Next, we will look at architecting an enterprise application.