Chapter 7. Building an ASP.NET Core Web Application

It is generally accepted that microservices are standalone applications that often expose RESTful APIs over HTTP(S). We’ve also seen microservices that are message-driven in nature and don’t expose RESTful APIs, but rather operate by receiving and publishing messages.

Another type of microservice is a web application. This might seem like an odd assertion to those of you who have spent some time maintaining bloated, legacy web app monoliths. However, I believe that, when built properly, a web application is nothing more than a microservice that has an explicit contract to expose HTML over some subset of its endpoints.

In this chapter we’ll take a look at how ASP.NET Core allows us to build web applications, but we’ll examine this functionality with an eye toward how we can build high-performance, scalable, highly available web applications designed to thrive in the cloud rather than simply using a new technology to build an upgraded version of a legacy monolith.

All of the code for this chapter can be found in the GitHub repository.

ASP.NET Core Basics

In this section  of the chapter we’re going to take a tour of the basics of building web applications with ASP.NET Core. This will look very familiar to people who have built applications based on the Open Web Interface for .NET (OWIN) in the past and may look very alien to readers coming from a purely Web Forms–based development background.

A lot of what you’ll see in this section ...

Get Building Microservices with ASP.NET Core now with the O’Reilly learning platform.

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