« first day (4320 days earlier)      last day (613 days later) » 

Dai
9:46 AM
I saw some new C# syntax on MS's ASP.NET docs and I don't recognize it, so does anyone know what this means?
From https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.http.itypedhttpclientfactory-1?view=dotnet-plat-ext-6.0

```
public class HomeController : ControllerBase(IApplicationBuilder app, ExampleClient exampleClient)
{
private readonly ExampleClient _exampleClient;

public HomeController(ExampleClient exampleClient)
{
_exampleClient = exampleClient;
}

public async Task<IActionResult> Index()
{
var response = await _exampleClient.GetAsync("/helloworld");
var text = await response.Content.ReadAsStringAsync();
What is the ControllerBase(IApplicationBuilder app, ExampleClient exampleClient) part? I've never seen that before and I don't see it documented in the C# 10.0 or C# 11.0 changes...
 
10:27 AM
[milleniumbug] no idea either, so I tried to copy it into Rider and it doesn't compile with C# 10 and .NET 6
[milleniumbug] due to that semicolon after Index it doesn't compile either way
[milleniumbug] Index() { ... }
 
Dai
actually... I think it's a copypasta typo...
the same (IApplicationBuilder app, ExampleClient exampleClient) substring appears in the example box immediately above
 
[milleniumbug] it also doesn't compile if we assume the definition of that ExampleClient class presented above
[milleniumbug] as it does not have a GetAsync method
 
Dai
 
Dai
damnit - I was doing the exact same thing!
also I've been awake 2.5 days straight
my recycle bin is now overflowing with sugarfree red bull cans
 

« first day (4320 days earlier)      last day (613 days later) »