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

ASP.NET Core 2.0 features


The new Microsoft.AspNet.Core.All package contains all ASP.NET Core 2.0 features in a single library. It includes authentication, MVC, Razor, monitoring, Kestrel support and many others. They are explained in more detail later in the book.

Note

Note that if you want to selectively add packages one by one, you can still reference them manually instead of using the single packages that contain it all but then you will miss several advantages as you will see here.

The runtime store is an important new component shipped with ASP.NET Core 2.0. It contains compiled packages, which were compiled using the native machine language and it is key for improved performance. All applications using the Microsoft.AspNet.Core.All package benefit from it, because they do not need to be deployed with all the dependent packages anymore. Everything is already there, so their deployment size will be reduced and their execution time will be optimized.

ASP.NET Core 2.0 allows you to create well-factored and testable web applications that follow the Model-View-Controller (MVC) pattern. We have dedicated a full chapter to this topic later in the book.

Furthermore, you can build HTTP services with full support for content negotiation using custom and built-in formatters such as JSON or XML as well as RESTful services.

ASP.NET Core 2.0 fully supports Razor which contains an efficient language for creating your views and Tag Helpers enable server-side code to participate in creating and rendering HTML elements in Razor files.

Model binding automatically maps data from HTTP requests to action method parameters and model validation automatically performs client and server side validation.

In terms of client-side development, ASP.NET Core 2.0 is designed to integrate seamlessly with a variety of client-side frameworks including AngularJS, KnockoutJS, and Bootstrap.

Additionally, it provides the following fundamental improvements:

  • ASP.NET MVC and Web API have been combined into a single framework
  • Modern client-side frameworks and development workflows
  • Environment-based configuration system ready for cloud hosting
  • Built-in dependency injection functionalities
  • New light-weight and modular HTTP request pipeline
  • Host the same application in IIS, self-host, Docker, Cloud and even in your own processes
  • Hosts multiple versions of an application or a component side-by-side
  • Ships entirely as NuGet packages
  • New tooling that simplifies modern web development
  • Simplified csproj file, making it easier to work with development environments other than Visual Studio (on Linux and macOS, for example)
  • The Program.cs class has been extended to fully automate the integration of Kestrel, the setting of the ContentRootPath, loading the configuration files, initializing the logging middleware, and other steps by only calling a single method
  • The Startup.cs has been simplified by moving logging and configuration into the WebHost builder initialization