-
Notifications
You must be signed in to change notification settings - Fork 27
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
RegisterWebApiModelBinders has no effect in Web API 2 #8
Comments
From previous discussions on this issue, I'm gathering that a simple I'd like to vote that we:
|
From @alexandrnikitin on June 16, 2014 18:43
Agreed, we should treat ModelBinders and ModelBinderProviders separately. Where I would leave |
In v4.0 the |
From @alexmg on January 22, 2014 14:32
From tommyj...@gmail.com on January 20, 2014 00:15:41
Registering Web API 2 model binders using the extension method
RegisterWebApiModelBinders
has no effect. It's missing the required metadata needed byAutofacWebApiModelBinderProvider
to resolve the model binder.Instead of using RegisterWebApiModelBinders, one can manually register the model binders, using:
builder.RegisterType<RequestContextModelBinder>().AsModelBinderForTypes(typeof(RequestContext));
Not sure if it is possible to make
RegisterWebApiModelBinders
work, otherwise it should probably be deprecated for Web API 2.Original issue: http://code.google.com/p/autofac/issues/detail?id=484
Copied from original issue: autofac/Autofac#484
The text was updated successfully, but these errors were encountered: