Closed
Description
.net version is 7.0.100-preview.3.22179.4
The following code will work:
string SayHello(string name) => $"Hello, {name}!.";
app.MapGet("/hello/{name}", SayHello)
.AddFilter(async (RouteHandlerInvocationContext context, RouteHandlerFilterDelegate next) =>
{
return await next(context);
});
But the following code doesn't work:
app.MapGet("/hello/{name}", (string name) => $"Hello, {name}!.")
.AddFilter(async (RouteHandlerInvocationContext context, RouteHandlerFilterDelegate next) =>
{
return await next(context);
});
System.NullReferenceException:“Object reference not set to an instance of an object.”