Blog Logo
TAGS

Generating Argument Expressions for Minimal APIs (Continued)

In this blog post, Andrew Lock explores behind the scenes of minimal APIs in ASP.NET Core Minimal APIs .NET 7 Source Code Dive, specifically focusing on Generating Argument Expressions for Minimal APIs. Andrew starts by showing how RequestDelegateFactory.CreateArgument() generates Expression trees for minimal API handlers. Then, he discusses examples of the effective code that CreateArgument() generates to call your handlers. Finally, he covers binding optional arrays of string, or StringValues to the query string, binding required arrays of string or StringValues, binding int[] to the query string, binding required services from DI, binding optional services from DI, binding optional form files with IFormFileCollection and IFormFile, binding to a required form file with IFormFileCollection and IFormFile, binding BindAsync types, and binding the request body to a type. This post focuses on generating argument expressions for minimal APIs (continued), which is part 5 of the series: Behind the Scenes of Minimal APIs. This blog post is a great read for those who want to learn more about creating Minimal APIs in ASP.NET Core and understand more about Binding optional arrays of string, or StringValues? to the query string.