-
Notifications
You must be signed in to change notification settings - Fork 20
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
FromHeader binding #23
Comments
Not yet. HeaderModelBinder exists in the aspnet/Mvc repo., but it's for very simple situations. I don't know why Microsoft never added a |
New behavior mimics existing ASP.NET MVC behavior of QueryString and Form value providers. Not really sure why this isn't included in that package. Didn't do thorough testing, but did notice one gotcha if identical header-keys are submitted: the values are combined as a single comma-separated string. Implements #23
New behavior mimics existing ASP.NET MVC behavior of QueryString and Form value providers. Not really sure why this isn't included in that package. Didn't do thorough testing, but did notice one gotcha if identical header-keys are submitted: the values are combined as a single comma-separated string. Implements #23
🎉 https://www.nuget.org/packages/HybridModelBinding/0.13.0 public class Person
{
[From(Source.Header)]
public int Age { get; set; }
}
|
Wow, thank you! |
Hey, binding works perfectly, just a small proposal, it would be great to have a possibility to override a binding name. For example i have a header - x-request-id, and by default binder is unable to bind header to property RequestId (unfortunately it's no possible to use dashes in names). As a solution, aditional parameter for an attribute could work. This could be also helpful not only for header binding. |
New behavior allows more flexibility when declaring properties as part of hybrid binding ecosystem. This includes allowing alternate valueProvider source-naming and ordering. The former allows using a provider (i.e. Header) with a different key than the property-name (i.e. X-Name). The latter allows implicit (via `CallerLineNumber`) and explicit-ordering based on the line the attribute is declared (declaring multiple attributes is now allowed). Ref. #23
New behavior allows more flexibility when declaring properties as part of hybrid binding ecosystem. This includes allowing alternate valueProvider source-naming and ordering. The former allows using a provider (i.e. Header) with a different key than the property-name (i.e. X-Name). The latter allows implicit (via `CallerLineNumber`) and explicit-ordering based on the line the attribute is declared (declaring multiple attributes is now allowed). Ref. #23
New behavior allows more flexibility when declaring properties as part of hybrid binding ecosystem. This includes allowing alternate valueProvider source-naming and ordering. The former allows using a provider (i.e. Header) with a different key than the property-name (i.e. X-Name). The latter allows implicit (via `CallerLineNumber`) and explicit-ordering based on the line the attribute is declared (declaring multiple attributes is now allowed). Ref. #23
New behavior allows more flexibility when declaring properties as part of hybrid binding ecosystem. This includes allowing alternate valueProvider source-naming and ordering. The former allows using a provider (i.e. Header) with a different key than the property-name (i.e. X-Name). The latter allows implicit (via `CallerLineNumber`) and explicit-ordering based on the line the attribute is declared (declaring multiple attributes is now allowed). Ref. #23
New behavior allows more flexibility when declaring properties as part of hybrid binding ecosystem. This includes allowing alternate valueProvider source-naming and ordering. The former allows using a provider (i.e. Header) with a different key than the property-name (i.e. X-Name). The latter allows implicit (via `CallerLineNumber`) and explicit-ordering based on the line the attribute is declared (declaring multiple attributes is now allowed). Ref. #23
New behavior allows more flexibility when declaring properties as part of hybrid binding ecosystem. This includes allowing alternate valueProvider source-naming and ordering. The former allows using a provider (i.e. Header) with a different key than the property-name (i.e. X-Name). The latter allows implicit (via `CallerLineNumber`) and explicit-ordering based on the line the attribute is declared (declaring multiple attributes is now allowed). Ref. #23
New behavior allows more flexibility when declaring properties as part of hybrid binding ecosystem. This includes allowing alternate valueProvider source-naming and ordering. The former allows using a provider (i.e. Header) with a different key than the property-name (i.e. X-Name). The latter allows implicit (via `CallerLineNumber`) and explicit-ordering based on the line the attribute is declared (declaring multiple attributes is now allowed). Ref. #23
New behavior allows more flexibility when declaring properties as part of hybrid binding ecosystem. This includes allowing alternate valueProvider source-naming and ordering. The former allows using a provider (i.e. Header) with a different key than the property-name (i.e. X-Name). The latter allows implicit (via `CallerLineNumber`) and explicit-ordering based on the line the attribute is declared (declaring multiple attributes is now allowed). Ref. #23
https://www.nuget.org/packages/HybridModelBinding/0.14.0 implements a new |
That's a great news! Great update! |
Is it possible somehow to bind properties to header values?
The text was updated successfully, but these errors were encountered: