Easier extension of FormatterParameterBinding

Topics: ASP.NET Web API
May 12, 2015 at 3:33 PM
Hi everybody,

I came accross a task when I had to manipulate the content of the request before reading it into the model. This can be done a number of ways, but I wanted to integrate into the Web API pipeline as tightly as possible and reuse most of the already existing functionality, so I chose to inherit from FormatterParameterBinding, but I found that it is quite hard to extend the functionality if you want to keep everything from the existing functionality (all the parameter checks and error messages and everything) and just wanted to modify the content.
The actual reading is done in line 105 in FormatterParameterBinding.cs, but if I override the method that contains this line to manipulate the content, I have to reimplement some of the functionality myself.
I would like to propose a solution to make this easier and without having to reimplement any functionality.
I think this could be a valuable contribution, do you agree?