Skip to content

Conversation

@mcshaz
Copy link
Contributor

@mcshaz mcshaz commented Apr 17, 2014

This project is really useful (and thanks once again). I wrote the testing framework about a year ago, and the api has changed since then, and some updates are available should you chose to use them:

-As per the heading of this pull request, the DataTablesParam model binder is now tested. This seems a fundemental part of how this application works, and errors in this have caught me out a few times. It tests whichever is the default binder for the DataTablesParam type in the Examples project, which you may not like, and this could be adjusted to instantiating a new instance of DataTablesModelBinder instead, but it has usually been problems surrounding the ModelBinder dictionary (rather than the ModelBinder itself) which has caused me grief in the past.
-In order to facilitate testing, the DataTablesModelBinder uses the ModelBindingContext, rather than the querystring. I have not performance tested, but this may add a few milliseconds?
-The DataTablesParam instantiator now includes an overload to instantiate all the lists at the specified capacity. This could be considered a micro-optimisation, but, as the length of the 6 collections is always known before instantiation, it seems to make sense to use this data.
-the ExecuteParamsAndTransform, due to the API change, had become an exact repeat of the ExecuteParams function, subsequent to the change in API last year. This now adds an anonymous transform function, used in a similar way to production code
-the viewmodel was no longer used, and is removed
-A few changes to make the syntax cleaner

mcintyre321 added a commit that referenced this pull request Apr 17, 2014
Testing for DataTablesParam ModelBinder
@mcintyre321 mcintyre321 merged commit 861f2ac into mcintyre321:master Apr 17, 2014
@mcintyre321
Copy link
Owner

Fab, look like great changes.

A lot of the code is still there from the original project, and a lot of it got hacked together, so there is a lot that could be improved still.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants