Reputation: 2642
How do i bind an object from header. Am using the [FromHeader(Name = "Custom-Object")]
but it seems to only be able to bind strings and sting arrays. Do i need to write custom binding or am i missing something here? I wonder why fromheader cannot bind complex object like frombody?
Upvotes: 6
Views: 5067
Reputation: 1363
Write custom binder by using IModelBinder and IModelBinderProvider that should resolve your problem.
Upvotes: 1