You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.
I was converting a C# webapi project to F# using the F# ASP.NET templates. Everything is working great except optional query parameters. I keep getting this error
{
"message": "The request is invalid.",
"messageDetail": "The parameters dictionary contains an invalid entry for parameter 'start' for method 'System.Threading.Tasks.Task`1[System.Net.Http.HttpResponseMessage] GetVendorFiles(Int32, System.Nullable`1[System.DateTime])' in 'Thor.WebApi.VendorFilesController'. The dictionary contains a value of type 'System.Reflection.Missing', but the parameter requires a value of type 'System.Nullable`1[System.DateTime]'."
}
For what it's worth, I rarely use the parameter bindings. I find request.GetQueryNameValuePairs() a more reliable mechanism, especially when you want optional parameters. F# doesn't seem to map well to the MVC conventions for parameter binding. I'm sure this is not the answer for which you hoped, but I've never been able to get parameter binding to work reliably. You ma want to raise this in https://github.com/Microsoft/visualfsharp/issues.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I was converting a C# webapi project to F# using the F# ASP.NET templates. Everything is working great except optional query parameters. I keep getting this error
F# function signature:
C# function signature:
Does any one know of any work arounds?
The text was updated successfully, but these errors were encountered: