I have a model class that I want to bind a query string to in my ASP.NET MVC Core (RC2) application.
I need to support underscores in query string keys to confirm to OAuth specs, but I want to work with title case property names in my application.
My model class looks like this:
class OauthParameters
{
public string ClientId {get; set;}
public string ResponseType {get; set;}
public string RedirectUri {get; set;}
}
so I'd like to bind query strings like client_id
, response_type
and redirect_uri
to it.
Is there a way for ASP.NET MVC Core to do this automagically or through an attribute annotation?
I've read some articles about writing custom model binders, but these seem to (1) be overly complex for what I'm trying to achieve and (2) are written for RC1 or earlier in mind and some of the syntax has changed.
Thanks in advance.