Exemplo n.º 1
0
        // Helper for ReadAs() to get a ModelBinderProvider to read FormUrl data.
        private static ModelBinderProvider CreateModelBindingProvider(HttpActionContext actionContext)
        {
            Contract.Assert(actionContext != null);

            ServicesContainer cs = actionContext.ControllerContext.Configuration.Services;
            IEnumerable <ModelBinderProvider> providers = cs.GetModelBinderProviders();
            ModelBinderProvider modelBinderProvider     = new CompositeModelBinderProvider(providers);

            return(modelBinderProvider);
        }