This is the code repository for Mastering ASP.NET Core 2.0, published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.
ASP.NET is an open source web framework that builds modern web apps and services. This book is your one-stop guide to the new features of ASP.NET Core 2.0, including web APIs and MVC. We begin with a brief overview of the basics, taking you through the MVC pattern, platforms, dependencies, and frameworks. We then move on to setting up and configuring the MVC environment before talking about routing and advanced routing options. Next, we'll look at model binding, controllers and actions, filters, user authentication, and testing.
All of the code is organized into folders. Each folder starts with a number followed by the application name. For example, Chapter02.
This the code bundle for Mastering ASP.NET Core 2.0. All the code file for the book are present in the code bundle. The files are book wide since there are a lot of dependencies to execute the file.
Use the following:
- Open solution BookShop.sln using Visual Studio 2017.
- Set Web as the startup project
- Start debugging.
- On the error message allow the execution of the migration.
- Go to Register and create an account as administrator and any others a non-administrator
The code will look like the following:
if (this.TempData.ContainsKey("key"))
{
var value = this.TempData["key"];
}
To follow the example code in this book, you'll need a computer running a reasonably recent version of Windows, macOS, or Linux. You'll also need a text editor to edit the code; I highly recommend using a text editor that allows you to open multiple files at a time and switch between them easily. Visual Studio 2015 or 2017 or Visual Studio Code come to my mind immediately. The latter is open source and is available on Windows, macOS, and Linux, and is a lightweight editor that nevertheless offers quite interesting features. Visual Studio should be well known to seasoned .NET developers and offers enterprise-level features, including rich debugging capabilities and code refactoring. It is available in different editions, ranging from Enterprise to Community, also with different costs associated, the Community edition is free, but, as can be expected, offers fewer less features than its paid counterpart. However, rest assured that to follow this book you can use any of them without any problems.
Click here if you have any feedback or suggestions.