skip to Main Content

How to define output parameter in Task<IActionResult> – Asp.net

I'm switching tech stacks so I'm a bit confused here. This function should return an object public async Task<IActionResult> Search(CoinModel Coin) { var date = Coin.tracking_date.ToLocalTime().ToString("dd/MM/yyyy"); var dateformat = DateTime.Parse(System.Web.HttpUtility.UrlDecode(date + " 00:00:00.0000000")); var issue = await _db.Coins.SingleOrDefaultAsync(c => c.coin…

VIEW QUESTION

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