In ASP.NET Core in Action, Third Edition you’ll learn how to:
- Build minimal APIs for serving JSON to client-side applications
- Create dynamic, server-side rendered applications using Razor Pages
- User authentication and authorization
- Store data using Entity Framework Core
- Unit and integration tests for ASP.NET Core applications
- Write custom middleware and components
Fully updated to ASP.NET Core 7.0! In ASP.NET Core in Action, Third Edition Microsoft MVP Andrew Lock teaches you how you can use your C# and .NET skills to build amazing cross-platform web applications. This revised bestseller reveals the latest .NET patterns, including minimal APIs and minimal hosting. Even if you've never worked with ASP.NET, you'll start creating productive cross-platform web apps fast. Illustrations and annotated code make learning visual and easy.
Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.
About the technology
The ASP.NET Core web framework delivers everything you need to build professional-quality web applications. With productivity-boosting libraries for server-side rendering, secure APIs, easy data access and more, you’ll spend your time implementing features instead of researching syntax and tracking down bugs. This book is your guide.
About the book
ASP.NET Core in Action, Third Edition shows you how to create production-grade web applications with ASP.NET Core 7.0. You’ll learn from hands-on examples, insightful illustrations, and nicely explained code. Updated coverage in this Third Edition includes creating minimal APIs, securing APIs with bearer tokens, WebApplicationBuilder, and more.
What's inside
- Minimal APIs for serving JSON
- Server-side rendering using Razor Pages
- Data access with Entity Framework Core
- Write custom middleware and components
About the reader
For beginning to intermediate web developers. Examples are in C#.
Table of Contents
1 Getting started with ASP.NET Core
PART 1 - GETTING STARTED WITH MINIMAL APIS
2 Understanding ASP.NET Core
3 Your first application
4 Handling requests with the middleware pipeline
5 Creating a JSON API with minimal APIs
6 Mapping URLs to endpoints using routing
7 Model binding and validation in minimal APIs
PART 2 - BUILDING COMPLETE APPLICATIONS
8 An introduction to dependency injection
9 Registering services with dependency injection
10 Configuring an ASP.NET Core application
11 Documenting APIs with OpenAPI
12 Saving data with Entity Framework Core
PART 3 - GENERATING HTML WITH RAZOR PAGES AND MVC
13 Creating a website with Razor Pages
14 Mapping URLs to Razor Pages using routing
15 Generating responses with page handlers in Razor Pages
16 Binding and validating requests with Razor Pages
17 Rendering HTML using Razor views
18 Building forms with Tag Helpers
19 Creating a website with MVC controllers
20 Creating an HTTP API using web API controllers
21 The MVC and Razor Pages filter pipeline
22 Creating custom MVC and Razor Page filters
PART 4 - SECURING AND DEPLOYING YOUR APPLICATIONS
23 Authentication: Adding users to your application with Identity
24 Authorization: Securing your application
25 Authentication and authorization for APIs
26 Monitoring and troubleshooting errors with logging
27 Publishing and deploying your application
28 Adding HTTPS to an application
29 Improving your application’s security
PART 5 - GOING FURTHER WITH ASP.NET CORE
30 Building ASP.NET Core apps with the generic host and Startup
31 Advanced configuration of ASP.NET Core
32 Building custom MVC and Razor Pages components
33 Calling remote APIs with IHttpClientFactory
34 Building background tasks and services
35 Testing applications with xUnit
36 Testing ASP.NET Core applications
About the author
Andrew Lock is a Microsoft MVP who has worked with ASP.NET Core since before its first release.
eBook License
End-User Warranty and License Agreement
1. Grant of License
Manning has authorized the download by you of an unrestricted number of copies of the electronic book (ebook) in any of the available formats. Manning grants you a nonexclusive, nontransferable license to use the ebook according to the terms and conditions herein. This License Agreement permits you to install the ebook on any and all your devices for your personal use only.
2. Restrictions
You shall not: (1) share, resell, rent, assign, timeshare, distribute, or transfer all or part of the ebook or any rights granted hereunder to any other person; (2) duplicate the ebook, except for a single backup or archival copy; (3) remove any proprietary notices, labels, or marks from the ebook; (4) transfer or sublicense title to the ebook to any other party.
3. Intellectual Property Protection
The ebook is owned by Manning and is protected by United States and international copyright and other intellectual property laws. Manning reserves all rights in the ebook not expressly granted herein. This license and your right to use the ebook terminate automatically if you violate any part of this Agreement. In the event of termination, you must remove the original and any copies of the ebook from all your devices.
4. Source Code Supplementary Material
Any source code files provided as a supplement to the book are freely available to the public for download. Reuse of the code is permitted, in whole or in part, including the creation of derivative works, provided that you acknowledge that you are using it and identify the source: title, publisher and year.
5. Limited Warranty
Manning warrants that the ebook files, a copy of which you are authorized to download, are free from defects in the operational sense that they can be read by a PDF Reader or ePub reader, or other. EXCEPT FOR THIS EXPRESS LIMITED WARRANTY, MANNING MAKES AND YOU RECEIVE NO WARRANTIES, EXPRESS, IMPLIED, STATUTORY OR IN ANY COMMUNICATION WITH YOU, AND MANNING SPECIFICALLY DISCLAIMS ANY OTHER WARRANTY INCLUDING THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS OR A PARTICULAR PURPOSE. MANNING DOES NOT WARRANT THAT THE OPERATION OF THE EBOOK WILL BE UNINTERRUPTED OR ERROR FREE. If the ebook was purchased in the United States, the above exclusions may not apply to you as some states do not allow the exclusion of implied warranties. In addition to the above warranty rights, you may also have other rights that vary from state to state.
6. Limitation of Liability
IN NO EVENT WILL MANNING BE LIABLE FOR ANY DAMAGES, WHETHER ARISING FOR TORT OR CONTRACT, INCLUDING LOSS OF DATA, LOST PROFITS, OR OTHER SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR INDIRECT DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE EBOOK.
7. General
This Agreement constitutes the entire agreement between you and Manning and supersedes any prior agreement concerning the ebook. This Agreement is governed by the laws of the State of New York.