ASP.NET Core in Action, Second Edition
Andrew Lock
  • MEAP began May 2020
  • Publication in Spring 2021 (estimated)
  • ISBN 9781617298301
  • 700 pages (estimated)
  • printed in black & white
free previous edition eBook included
An eBook copy of the previous edition of this book is included at no additional cost. It will be automatically added to your Manning Bookshelf within 24 hours of purchase.

If you want a great comprehensive book to help you learn ASP.Net Core 3, look no further.

Tanya Wilke
Fully updated to ASP.NET 3.1, ASP.NET Core in Action, Second Edition is a hands-on primer to building cross-platform web applications with your C# and .NET skills. Even if you’ve never worked with ASP.NET you’ll start creating productive cross-platform web apps fast. And don’t worry about late-breaking changes to ASP.NET Core. With this Manning Early Access Program edition you’ll get updates right up until it ships to the printer, so you’re always working with the latest version of the technology.

About the Technology

ASP.NET Core is a highly flexible, high performance cross platform web framework that’s entirely free and open source. ASP.NET Core developers enjoy choice without compromise, benefiting from both a mature, well-supported stack and the freedom to develop and deploy from and onto any cloud or on-prem platform. Now in version 3.1, the latest version of ASP.NET Core includes powerful new additions for building server-side apps and background services.

About the book

ASP.NET Core in Action, Second Edition opens up the world of cross-platform web development with ASP.NET Core. You’ll start with a crash course in .NET Core, immediately cutting the cord between ASP.NET and Windows. Then, you’ll begin to build amazing web applications step by step, systematically adding essential features like logins, configuration, dependency injection, and custom components. Along the way, you’ll mix in important process steps like testing, multiplatform deployment, and security. Fully updated to version 3.1 and primed for live updating to .NET 5, this new edition fully covers new features such as server-side apps with Razor Pages, and the new ASP.NET Core hosting paradigm.
Table of Contents detailed table of contents

PART 1 Building your first applications

1 Getting started with ASP.NET Core

1.1 An introduction to ASP.NET Core

1.1.1 Using a web framework

1.1.2 The benefits and limitations of ASP.NET

1.1.3 What is ASP.NET Core?

1.2 When to choose ASP.NET Core

1.2.1 What type of applications can you build?

1.2.2 If you’re new to .NET development

1.2.3 If you’re a .NET Framework developer creating a new application

1.2.4 Converting an existing ASP.NET application to ASP.NET Core

1.3 How does ASP.NET Core work?

1.3.1 How does an HTTP web request work?

1.3.2 How does ASP.NET Core process a request?

1.4 What you will learn in this book

1.5 Summary

2 Your first application

2.1 A brief overview of an ASP.NET Core application

2.2 Creating your first ASP.NET Core application

2.2.1 Using a template to get started

2.2.2 Building the application

2.3 Running the web application

2.4 Understanding the project layout

2.5 The csproj project file: defining your dependencies

2.6 The Program class: building a web host

2.7 The Startup class: configuring your application

2.7.1 Adding and configuring services

2.7.2 Defining how requests are handled with middleware

2.8 Generating responses with Razor Pages

2.8.1 Generating HTML with Razor Pages

2.8.2 Handling request logic with PageModels and handlers

2.9 Summary

3 Handling requests with the middleware pipeline

3.1 What is middleware?

3.2 Combining middleware in a pipeline

3.2.1 Simple pipeline scenario 1: a holding page

3.2.2 Simple pipeline scenario 2: Handling static files

3.2.3 Simple pipeline scenario 3: A Razor Pages application

3.3 Handling errors using middleware

3.3.1 Viewing exceptions in development: DeveloperExceptionPage

3.3.2 Handling exceptions in production: ExceptionHandlerMiddleware

3.3.3 Handling other errors: StatusCodePagesMiddleware

3.3.4 Error handling middleware and Web APIs

3.4 Summary

4 Creating a web site with Razor Pages

4.1 An introduction to Razor Pages

4.1.1 Exploring a typical Razor Page

4.1.2 The MVC design pattern

4.1.3 Applying the MVC design pattern to Razor Pages

4.1.4 Adding Razor Pages to your application

4.2 Razor Pages vs MVC in ASP.NET Core

4.2.1 MVC controllers in ASP.NET Core

4.2.2 The benefits of Razor Pages

4.2.3 When to choose MVC controllers over Razor Pages

4.3 Razor Pages and page handlers

4.3.1 Accepting parameters to page handlers

4.3.2 Returning responses with ActionResults

4.4 Summary

5 Mapping URLs to Razor Pages using routing

5.1 What is routing?

5.2 Routing in ASP.NET Core

5.2.1 Using endpoint routing in ASP.NET Core

5.2.2 Convention-based routing vs attribute routing

5.2.3 Routing to Razor Pages

5.3 Customizing Razor Page route templates

5.3.1 Adding a segment to a Razor Page route template

5.3.2 Replacing a Razor Page route template completely

5.4 Exploring the route template syntax

5.4.1 Using optional and default values

5.4.2 Adding additional constraints to route parameters

5.4.3 Matching arbitrary URLs with the catch-all parameter

5.5 Generating URLs from route parameters

5.5.1 Generating URLs for a Razor Page

5.5.2 Generating URLs for an MVC controller

5.5.3 Generating URLs with ActionResults

5.5.4 Generating URLs from other parts of your application

5.6 Selecting a page handler to invoke

5.7 Customizing conventions with Razor Pages

5.8 Summary

6 The binding model: retrieving and validating user input

6.1 Understanding the models in Razor Pages and MVC

6.2 From request to model: making the request useful

6.2.1 Binding simple types

6.2.2 Binding complex types

6.2.3 Choosing a binding source

6.3 Handling user input with model validation

6.3.1 The need for validation

6.3.2 Using DataAnnotations attributes for validation

6.3.3 Validating on the server for safety

6.3.4 Validating on the client for user experience

6.4 Organizing your binding models in Razor Pages

6.5 Summary

7 Rendering HTML using Razor views

7.1 Views: rendering the user interface

7.2 Creating Razor views

7.2.1 Razor views and code-behind

7.2.2 Introducing Razor templates

7.2.3 Passing data to views

7.3 Creating dynamic web pages with Razor

7.3.1 Using C# in Razor templates

7.3.2 Adding loops and conditionals to Razor templates

7.3.3 Rendering HTML with Raw

7.4 Layouts, partial views, and _ViewStart

7.4.1 Using layouts for shared markup

7.4.2 Overriding parent layouts using sections

7.4.3 Using partial views to encapsulate markup

7.4.4 Running code on every view with _ViewStart and _ViewImports

7.5 Selecting a view from an MVC controller

7.6 Summary

8 Building forms with Tag Helpers

8.1 Catering to editors with Tag Helpers

8.2 Creating forms using Tag Helpers

8.2.1 The Form Tag Helper

8.2.2 The Label Tag Helper

8.2.3 The Input and Textarea Tag Helpers

8.2.4 The Select Tag Helper

8.2.5 The Validation Message and Validation Summary Tag Helpers

8.4 Cache-busting with the Append Version Tag Helper

8.5 Using conditional markup with the Environment Tag Helper

8.6 Summary

9 Creating a Web API for mobile and client applications using MVC

PART 2 Building complete applications

10 Service configuration with dependency injection

11 Configuring an ASP.NET Core application

12 Saving data with Entity Framework Core

13 The MVC filter pipeline

14 Authentication: adding users to your application with Identity

15 Authorisation: Securing your application

16 Publishing and deploying your application

PART 3 Extending your application

17 Monitoring and troubleshooting errors with logging

18 Improving your application’s security

19 Building custom components

20 Building custom MVC and Razor Pages components

21 Calling remote APIs with IHttpClientFactory

22 Building background tasks and services

23 Testing your application

Appendixes

Appendix A: Installing and configuring your development environment

Appendix B: Getting to grips with .NET versioning

What's inside

  • Covers ASP.NET Core 3.1
  • Dynamic page generation with the Razor templating engine
  • Server-side apps with Razor Pages
  • Authentication and authorization
  • Unit tests and integration tests for ASP.NET Core apps
  • Create a Web API for serving JSON to client-side applications
  • Developing ASP.NET Core apps for non-Windows servers

About the reader

Readers need intermediate experience with C# or a similar language.

About the author

Andrew Lock is a Microsoft MVP who has been working with ASP.NET Core since before the first release. He has a PhD in digital image processing, and has been developing professionally using .NET for the last 10 years.

placing your order...

Don't refresh or navigate away from the page.
Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
print book $35.99 $59.99 pBook + eBook + liveBook
includes previous edition eBook
Additional shipping charges may apply
ASP.NET Core in Action, Second Edition (print book) added to cart
continue shopping
go to cart

eBook $38.39 $47.99 3 formats + liveBook
includes previous edition eBook
ASP.NET Core in Action, Second Edition (eBook) added to cart
continue shopping
go to cart

Prices displayed in rupees will be charged in USD when you check out.
customers also reading

This book 1-hop 2-hops 3-hops

FREE domestic shipping on three or more pBooks