Validating Start/End Dates with Fluent Validation for MVC 4
In my current contract I needed to add date filtering to a grid of search results in and MVC view – how hard could it be? Well the filtering was the easy bit, validating the user input proved to be much more problematic. The view that I had contained, among other things, a couple of fields for Start and End Date where the user would select the dates using a jQuery date picker. I knew that I could rely on standard MVC validation to make sure that the user had entered a valid date, but how do I ensure that they have entered an End Date that falls AFTER the Start Date? This simple requirement is not something that can be acheived with the standard Data Annotation attributes but I was lucky as the project already had made use of the FluentValidation extension.
Read moreDiscovering T4MVC – Replacing Literal Strings with Strongly Typed Helpers
One of the things I love about working as a contractor is getting exposure to technologies, tools and utilities that will improve my coding and help me produce better code – geeky but true. My most recent contract is no exception and this time I’ve decided to share this little gem of an extension which will remove those pesky literal string from your MVC Views.
Read moreA New Year Cometh
So it’s New Years Eve and looking back at the last year I’m pretty happy with how it’s gone. Since deciding to leave the rat race that is permanent employment in favor of contracting I not been out of work for long and the short time between contracts has been useful for getting up to speed with new techniques and technologies. Nobody can know it all, it’s just not possible, so I carefully pick my fights in terms of what I invest time in learning.
Read moreNexus 4: Ordering on Launch Day – Never Again
Dabbling in Android as I do, when I recently saw that Google were releasing the new Nexus phone (the Nexus 4) I thought to myself, “hell, why not – it’s nearly Christmas after all and I’ve been good all year”.
So this morning I logged into the Play Store and along with 1000s of other waited, periodically tapping F5 waiting to see the ‘Notify Me’ button change to ‘Add to Cart’. When it did (at about 8:05 am) all hell broke loose. I added the 16GB version of the phone to my cart and then tried to add the ‘bumper case’ – which resulted in a nice error message and notification that my cart was now empty.
Ok, forget the case for now, just get the phone sorted (I can order the case in a day or so when the smoke has settled). I must have tried a dozen times to get to the payment screen. Sometimes the ‘Add to Cart’ button would revert to ‘Notify Me’ and then back again sometimes I got an error when I added the phone to the cart, other times it would be when I clicked on the Go To Checkout button.
Read moreDealing with Recruiters – a Contractors Survival Guide
I’ve been contracting for about a year now and this has meant that I’ve had numerous dealings with recruiters and recruitment agencies. While I’ve been quite successful in obtaining contracts I’m afraid that my opinion of many recruiters (not necessarily the agencies themselves) is that they do not provide any value to the process, indeed the detract from it.
Read more