ToExpando() method fails when Update() called with Request.Form #14

Closed
rogerpence opened this Issue Mar 1, 2011 · 1 comment

Comments

Projects
None yet
1 participant

When you use: tbl.Update( Request.Form, 25 ) (where 25 is the key), ToExpando() fails on line 75 (of Massive2) saying "TargetParameterCountException was unhandled..."
I'm pretty sure that the problem is line 69 where a test for NameValueCollection is performed, but the incoming form is of type System.Web.HttpValueCollection (despite what the docs say about HttpRequest.Form and its type!).

Here is a clue: http://dylanbeattie.blogspot.com/2008/12/mocking-querystring-collection-in.html

The fix is to change line 69 (of Massive2) to use the is operator:
if (o is NameValueCollection ) {

HttpNameValueCollection is very weird! It seems to magically appear where you'd expect a NameValueCollection.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment