-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
ASP.NET Core 9 Web API Cookbook
By :
ASP.NET Core 9 Web API Cookbook aims to be your comprehensive toolbox for building web APIs with ASP.NET Core 9—Microsoft’s latest version of ASP.NET Core. Our goal is to give you practical recipes you can use on the job. This cookbook provides step-by-step solutions to workaday problems such as implementing efficient data access patterns and secure authentication flows, to leveraging cutting-edge technologies such as .NET Aspire for cloud orchestration and distributed caching with HybridCache.
Throughout multiple chapters, we will cover the entire spectrum of RESTful APIs—from implementing robust testing strategies in Chapter 7 to working with .NET Aspire in Chapter 9 and tackling caching in Chapter 10. While RESTful APIs using JSON are the primary focus, the ASP.NET Core 9 web API offers additional powerful technologies for building APIs, such as GraphQL for efficient querying, gRPC for high-performance communication, and SignalR for real-time functionality. If you are transitioning from a legacy .NET Framework background, don’t miss the chapter on middleware. Middleware is perhaps the most significant architectural change from the module and handler system in .NET Framework.
In this chapter, we will explore best practices for retrieving data from an ASP.NET Core web API, including techniques for communicating from the data access layer to the consumer of the API. We will focus on paging and retrieving data with Entity Framework (EF) Core. We will also cover two of the three new LINQ methods, CountBy and AggregateBy, to return additional grouping information on your data.
The following recipes will be covered in this chapter:
ProblemDetails to return more robust error informationCountByKeySet paginationAggregateBy LINQ method to return the average price per categoryFree Benefits with Your Book
Your purchase includes a free PDF copy of this book along with other exclusive benefits. Check the Free Benefits with Your Book section in the Preface to unlock them instantly and maximize your learning experience.