Book Image

Learning ASP.NET Core 2.0

By : Jason De Oliveira, Michel Bruchet
Book Image

Learning ASP.NET Core 2.0

By: Jason De Oliveira, Michel Bruchet

Overview of this book

The ability to develop web applications that are highly efficient but also easy to maintain has become imperative to many businesses. ASP.NET Core 2.0 is an open source framework from Microsoft, which makes it easy to build cross-platform web applications that are modern and dynamic. This book will take you through all of the essential concepts in ASP.NET Core 2.0, so you can learn how to build powerful web applications. The book starts with a brief introduction to the ASP.NET Core framework and the improvements made in the latest release, ASP.NET Core 2.0. You will then build, test, and debug your first web application very quickly. Once you understand the basic structure of ASP.NET Core 2.0 web applications, you'll dive deeper into more complex concepts and scenarios. Moving on, we'll explain how to take advantage of widely used frameworks such as Model View Controller and Entity Framework Core 2 and you'll learn how to secure your applications. Finally, we'll show you how to deploy and monitor your applications using Azure, AWS, and Docker. After reading the book, you'll be able to develop efficient and robust web applications in ASP.NET Core 2.0 that have high levels of customer satisfaction and adoption.
Table of Contents (19 chapters)
Title Page
Credits
Foreword
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Chapter 1. What is ASP.NET Core 2.0?

The first preview release of ASP.NET came out almost 15 years ago as part of the .NET Framework. Since then millions of software developers have used it to build and run all types of great web applications. Over the years Microsoft has added and evolved many of its features until coming up with a complete redesign of the ASP.NET Framework called ASP.NET Core in June 2016. After ASP.NET Core 1.0 and 1.1, version 2.0 is the third and latest installment of ASP.NET Core. Let's see what it offers and when it makes sense to use it in your projects.

ASP.NET Core 2.0 is a new open-source and cross-platform framework for building modern cloud-based applications, such as web applications, Internet of Things (IoT) applications and even mobile backend.

ASP.NET Core 2.0 applications run on the .NET Core Framework as well as on the full .NET Framework. The ASP.NET Core Framework was architected to provide an optimized development framework for applications, which have to be deployed either within the cloud or on-premises. It consists of modular components with minimal overhead, so you retain a high degree of flexibility when conceiving and implementing your software solutions. You can develop and run your ASP.NET Core 2.0 applications on Windows, Linux, and macOS.

In the following diagram you can see how the different .NET Framework versions and components work together:

ASP.NET Core 2.0 includes several architectural changes that result in a much leaner and more modular framework when compared to the framework that came before it. It is no longer based on System.Web.dll, instead, it uses a set of granular and well factored NuGet packages. This allows optimizing of applications to include just the NuGet packages that are really needed.

The benefits of a smaller application surface area include:

  • Better security
  • Reduced dependencies between components
  • Improved performance
  • Decreased optimized financial costs in a pay-for-what-you-use cloud consumer world

As a developer, when building applications based on the classic .NET Framework, you must choose between six application models (WPF, Windows Forms, Web Forms, Web MVC, Web API, and Xamarin), which can be confusing and not very productive.

With the release of the ASP.NET Core 1.0 and 1.1, this was optimized and reduced to three different application models, with the drawback that you cannot share code between them.

With ASP.NET Core 2.0, the number of application models was further reduced to two and code is now sharable, meaning that you can now reuse more than 90% of your code. For you as a developer, this makes you more productive and allows for switching between application models quickly and easily.

In this chapter, we will cover the following topics:

  • ASP.NET 2.0 features
  • Cross-platform support
  • Microservice architecture
  • Working with Docker and containers
  • Performance and scalability
  • Side-by-side deployments
  • Technology restrictions
  • When to choose ASP.NET Core 2.0