More fluent

Hi,
Would it be possible to make this compile ?

namespace dotnetisolated;

uses
  microsoft.Extensions.Hosting;
  
begin

  var host := new HostBuilder
    .ConfigureFunctionsWorkerDefaults
    .Build;
    
  host.Run;
end.

I get

E:                   No static member "ConfigureFunctionsWorkerDefaults" on type "HostBuilder" [/Users/JohnMoshakis/Documents/develop/Echoes/Core/dotnet-isolated/Program.pas (9)]

The following works but I dont think it looks as nice

namespace dotnetisolated;

uses
  microsoft.Extensions.Hosting;
  
begin

  var host := (new HostBuilder)
    .ConfigureFunctionsWorkerDefaults
    .Build;
    
  host.Run;
end.

Cheers,
John

No because there’s no way to tell apart where the type name ends and the method/property you wanna access on the instance starts. You need to add () to it:

var host := new HostBuilder().ConfigureFunctionsWorkerDefaults.Build;

will work.