1. Why ASP.NET Core ?
If you’re in a hurry, you can safely skip this chapter and head straight to the Creating our Web Site chapter. This Why ASP.NET Core chapter is there for those that want to know why ASP.NET Core should be used.
1.1 What is it ?
In a nutshell, ASP.NET Core is a technology used to create Web applications.
Web applications are used with a browser. Examples of Web applications are Facebook, Google, and in fact most of the services you use.
When you enter an http://something url in your browser, you get a Web application.
Simply put, ASP.NET Core can be used to create a Web application like Facebook, or a store, which is what we do in this book’s exercises.
1.2 Why use it ?
In case you know .NET and need to create a Web application, using ASP.NET makes sense since you can reuse your knowledge of the .NET Framework (or .NET Core) and language abilities (like C# and VB.NET).
At this time, there are two versions of ASP.NET:
- ASP.NET 4.6, using the .NET Framework 4.6.
- ASP.NET Core.
ASP.NET 4.6 is the legacy version coming all the way from the year 2001. It is full of features but should be used mostly when porting existing .NET code, since the .NET Core platform doesn’t have all of the classes that were available in .NET. However, ASP.NET 4.6 is limited to running on Windows platforms.
ASP.NET Core should be considered for new projects. It is cross-platform (Windows, Linux, OS-X, Docker), scalable and efficient. This book is about ASP.NET Core.
ASP.NET Core can be used to produce APIs and HTML pages out of the box. In order to render HTML, it sports an MVC middleware which we’ll learn in this book.
1.3 Competing technologies
There are many technology stacks used to create Web applications. On a technological standpoint the following stacks would for instance allow to develop applications in a way similar to ASP.NET Core :
- Node.JS + Express
- Ruby on Rails
- Meteor
Selecting one technology or another can be debated for a while. It often boils down to beliefs or preferences, but there can be good reasons. For instance, if you know JavaScript and HTTP but nothing about .NET, you’ll probably get an easier time with Node.JS + Express than with ASP.NET Core.