skip to Main Content

Returning a Task in app.GetMap() function – Asp.net

I'm trying to write a simple string from the user-agent request headers in to the browser. var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); app.MapGet("/", (context) => return context.Request.Headers["User-Agent"].ToString();); app.Run(); This gives a compile error Cannot convert expression type 'string'…

VIEW QUESTION
Back To Top
Search