Quantcast
Channel: Andrew Lock | .NET Escapades
Viewing all articles
Browse latest Browse all 743

ASP.NET Core in Action, Version 3 update

$
0
0

In this post I give a quick update on why my blog hasn't been as active as usual. The short answer is: I've been head down working on my new book, ASP.NET Core in Action, Third Edition!

Your blog has been quiet, what gives?

If you're a regular follower of my blog, you may have noticed that the number of posts I've written have slowed over the last few months. Up to this year I always made sure to release a blog post every week, but I struggled to find the time while also working full time and trying to write a book! I've managed it in the past, but this year it just got too much 😅

The good news is, the vast majority of ASP.NET Core in Action, Third Edition is finished! I've written the first drafts of all the chapters, and a large part of the editing is finished too. There's still several layers of editing and proofing to go through, but the end is in sight! 🎉

If you've already picked up a copy via the Manning Early Access Program (MEAP) then first of all: thank you! 🙏 With this program you can comment and ask questions on the book forum, so if you find something confusing or which I haven't explained clearly, you can get an answer and help make the book better for everyone else.

You can leave comments and questions in the livebook

What's new in this version?

In case you hadn't noticed, ASP.NET Core moves fast these days! When I started writing the first version of ASP.NET Core in Action, 1.0 had only just been released. In the course of writing the first version, Microsoft released 1.1, and 2.0, which left me scrambling to keep up! The second version of the book targeted .NET Core 3.1, in which I shifted the focus of the book towards Razor Pages (my preferred server-rendering stack) instead of MVC.

A quick reminder that .NET Core 3.1 is now not supported, as of 13 December 2022.

In the latest version of the book, I have fully updated to .NET 7, which was released last month, in November 2022. That means:

  • By default, examples are all based on "minimal hosting" AKA WebApplication, introduced in .NET 6, to reduce the amount of boilerplate required.
  • The introduction to ASP.NET Core focuses on minimal APIs, as they're a great new way to introduce ASP.NET Core.
  • I still cover using Razor Pages for server-rendered applications, so there's something for you no matter whether you're building an API or an app.
  • I use newer APIs where available, such as using OptionsBuilder and ConfigurationManager.
  • The examples use modern C# features such as records, switch expressions, and the required modifier. I don't go overboard with these, nudging the features towards you instead of forcing them on you everywhere 😉
  • The book and chapters have been structured to be more approachable, but overall there's a lot more content than in version 2!

You can find all the details about the book on manning.com, but I thought I'd share the high level outline here too. The book is split into 5 roughly equal parts, with 36 chapters in total.

Note that I'm still editing and finalising the book, so I can't guarantee that this will be the final table of contents - be sure to check manning.com for updates!

In the first chapter you'll get an overview of ASP.NET Core, what it is, what you can build with it, and your basic mental model for how it works

  • 1. Getting started with ASP.NET Core

In part 1, you’ll go from a standing start all the way to building your first API applications using minimal APIs. We'll cover the middleware pipeline, routing, model binding, validation, and new features in .NET 7, such as filters and route groups.

  • 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 dives deeper into the framework and looks at a variety of components that you’ll inevitably need when you want to build more complex apps, such as dependency injection. By the end of this part, you’ll be able to build dynamic applications that can be deployed to multiple environments, each with a different configuration, saving data to a database.

  • 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

We cover a lot of ground in part 3: you’ll learn all about the Razor Pages and MVC frameworks used by ASP.NET Core to create server-rendered apps. Not only do we cover routing and returning results with Razor Pages, we cover the Razor syntax, Tag Helpers, MVC and API controllers, and the filter pipeline!

  • 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 focuses on security and deployment. You'll learn how to add user profiles to your application using ASP.NET Core Identity and how to protect your apps and APIs using authorization. On the security side you'll learn why you should always use HTTPS, and various attacks to watch out for when building your apps. On the deployment side you'll learn about publishing, and the Microsoft.Extensions.Logging framework.

  • 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 your application
    • 29. Improving your application’s security

In the final part of the book, we look at four different topics that build on what you’ve learned so far: customizing ASP.NET Core to your needs, interacting with third-party HTTP APIs, background services, and testing. I also discuss the generic host and the Startup class, how it compares to the new WebApplication "minimal hosting model", and when you should choose each one.

  • 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

Viewing all articles
Browse latest Browse all 743

Trending Articles