I was looking to try and add a Protobuf ValueProviderFactory to MVC3 so that I could pick out the MIME type and deserialize the raw data into objects for action parameters. I co
It turns out that it is not read only and you can add providers as follows:
ValueProviderFactories.Factories.Add(new MyValueProviderFactory());
I would have know this had I checked myself!
I've done some more searching today, and this blog post seems to suggest that the DependencyResolver
will find any classes that inherit ValueProviderFactory
. I'm using MEF for dependency resolution so I can just add an Export attribute and it'll get picked up automatically.
I now have a further issue writing a custom ValueProviderFactory for protobuf-net.