Value returned from a RequestDelegate (ASP0016)
Ce contenu n’est pas encore disponible dans votre langue.
Key dotnet.api.requestdelegate-returns-value · Severity warning · Category api
ASP.NET Core analyzer ASP0016. Flags a RequestDelegate lambda that returns a value. The value is discarded and never written to the response.
Incorrect
Section titled “Incorrect”app.Run(context => Task.FromResult("ok"));Correct
Section titled “Correct”app.Run(context => context.Response.WriteAsync("ok"));