Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update startup to explicitly construct a func #1

Closed
wants to merge 1 commit into from

Conversation

cartermp
Copy link
Contributor

No casting needed!

@halter73
Copy link
Owner

Thanks for fixing this! I tried out these changes and it appears we're losing the info from the original method when explicitly constructing the Func. In the C# version where we cast, Delegate.Method contains the same MethodInfo you'd get from Type.GetMethod or similar.

Is this something that could be fixed?

Here's the exact error I saw. It's looking for an attribute like HttpGet which won't be necessary after dotnet/aspnetcore#30448, but parameter names and attributes are still important.

Unhandled exception. System.InvalidOperationException: Action must have a pattern. Is it missing a Route attribute?
   at Microsoft.AspNetCore.Builder.MapActionEndpointRouteBuilderExtensions.MapAction(IEndpointRouteBuilder endpoints, Delegate action)
   at <StartupCode$HoudiniPlaygroundFSharp>[email protected](IEndpointRouteBuilder endpoints) in C:\dev\halter73\HoudiniPlaygroundFSharp\Startup.fs:line 34
   ...

@cartermp
Copy link
Contributor Author

cartermp commented Mar 1, 2021

Is this something that could be fixed?

I think it's a bug in F#, yeah. But I can't assess what the priority is at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants