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
Today we (cc: @nkeenan38) tried to use TryBindQueryString, or the Context.tryBindQuery<_> function to bind to an object that contained PascalCase for what was snake_case in the query string.
type UserQueryInfo =
{ [<FromQuery(Name = "user_id")>]
UserId: string }
With a querystring ?user_id=2345678, this won't work. Context.tryBindQuery<_> context will complain that it cannot find UserId.
So I looked over the code and noticed that the dictionary of key-value pairs is inspected with case-insensitivity, but other than that it must be an exact match. Yet it would be awesome if we can either allow automatic conversion of snake_case => SnakeCase properties, or that one of the MVC attributes get recognized.
I think FromQueryAttribute is a good candidate and greatly improves the usability of this function.
The text was updated successfully, but these errors were encountered:
Today we (cc: @nkeenan38) tried to use
TryBindQueryString
, or theContext.tryBindQuery<_>
function to bind to an object that contained PascalCase for what wassnake_case
in the query string.With a querystring
?user_id=2345678
, this won't work.Context.tryBindQuery<_> context
will complain that it cannot findUserId
.So I looked over the code and noticed that the dictionary of key-value pairs is inspected with case-insensitivity, but other than that it must be an exact match. Yet it would be awesome if we can either allow automatic conversion of
snake_case => SnakeCase
properties, or that one of the MVC attributes get recognized.I think
FromQueryAttribute
is a good candidate and greatly improves the usability of this function.The text was updated successfully, but these errors were encountered: