5 Replies
Adjusted my question..
pretty sure I just found a bug :thinkang:
I can inject absolutely anything and do the pretty syntax
anything but HttpContext
IHttpContextAccessor works, [FromBody] works, random services work
holy I found the solution here https://stackoverflow.com/questions/77270839/some-minimal-api-endpoints-not-returning-values-warning-asp0016-do-not-return
But now my rider ide is literaly lying to me. it works but I get an this error :200_blast:
okay at least its only rider, not vs :Ok:
Just add a cancellation token
It's best practice anyways
yea I saw that
its just pretty funny, i was making a minimal example sample to show someone how easy and simple aspnetcore is compared to the go example he showed me.
And immediately I ran into some weird cryptic gotcha that I needed like 2 hours to solve and im a 5 year experience all in on c# and aspnetcore andy 😹
now i hav to add "dude just add this CancellationToken thing, that you dont use, to the function signature, BUT only if you actually use the HttpContext"