Open oleksandr-bilyk opened 1 year ago
@oleksandr-bilyk I think right now it does already do it, if you pass the lambda in the call.
Also, should this work with any delegate type instead? I'm not keen on "Func is better" stuff which is already having few edge cases in overload resolution.
Likely a special case for #1131
You can write some code to work around this if you want, like I did in https://github.com/brianrourkeboll/FSharp.AspNetCore.WebAppBuilder; a few others have experimented with similar things, I believe, including @lucasteles, who opened #1131.
Also note that AFAIK the attributes currently are not captured, i.e. since FromServices
will be correctly inferred everything will work as expected.
@brianrourkeboll Yes, I ended up creating this https://github.com/lucasteles/FSharp.MinimalApi also
I propose F# implicitly cast F# fun with parameter attributes to C# delegate. It will help to write ASP.NET minimal API in short way
To do the same on F# I must create separate function.
C# looks better for this