An important tool when using MVC xVal version 1.0 is released, xVal is a validation helper for ASP.NET MVC that lets you use your own choice of server-side validation framework (e.g., Microsoft’s DataAnnotations attributes, or Castle Validator, or NHibernate Validaion) and dynamically generates client-side validation code from your rules.
When you are using MVC you will come across using the ModelState, and the most common use is ModelState.IsValid, if you've not used this before then check out Validating Model Data in an MVC Application or xVal - a validation framework for ASP.NET MVC, what I did come across is an exception beyound the normal checks, that a table was missing from the database. Although the error was recorded in the ModelState, it did not raise any exception and hence the exception handling did not capture the message. To record the Exception you'll need to go over the collection and this code allows you to do this:
foreach (var value in ModelState.Values)
foreach (var error in value.Errors )
throw new Exception (error.ErrorMessage, error.Exception);
I've been playing with Windows 7 for a little while now and I am impressed it lokks like Microsoft have got it right. I'm a power user and if it works for me I can say it is going to work for Mr Average Joe. I'd thought I draw up a number of special features that I have found in my travels around Windows 7.
Problem Steps Recorder
You can use Problem Steps Recorder to automatically capture the steps you take on a computer, including a text description of where you clicked and a picture of the screen during each click (called a screen shot). Once you capture these steps, you can save them to a file that can be used by a support professional or someone else helping you with a computer problem.
To start type PSR in the Start menu search box
More details from Tech Republic
Problem Steps Recorder with Jeremy Chapman
You now have the ability directly from within Windows 7 to burn ISO images directly to CD or DVD, if you'd like to know how to do it check out Burn ISO Images Natively in Windows 7 Burn ISO Images Natively in Windows 7
Switch to a projector
Windows 7 now provides a standard way to switch your display from one monitor to another, or a projector - just press Win+P or run DisplaySwitch.exe and choose your preferred display.
Calibrating your screen
I've done this before using Windows Media Centre, nand now you can calibrate your screen by running Display Colour Calibration Wizard, Click Start, type DCCW and press Enter to give it a try.
If you've not already tried this Right-Click has come it to it's own with so many features available, and making it so much faster to perform your day to day actions
Custom power switch
By default, Windows 7 displays a plain text 'Shut down' button on the Start menu, but it only takes a moment to change this action to something else. If you reboot your PC a few times every day then that might make more sense as a default action: right-click the Start orb, select Properties and set the 'Power boot action' to 'Restart' to make it happen.
Give the menu bar a shake
If you shake the menu bar all the other windows minimize, how cool is that?
If you have multiple windows open on your desktop and things are getting too cluttered, it used to be a time-consuming process to close them all down. In Windows 7 you can use the Aero Shake feature to minimise everything in seconds, using a cool mouse gesture. Grab the title bar of the window you wish to keep open and give it a shake, and rejoice in a clear desktop area.
Use Sticky Notes
The Sticky Notes app is both simpler and more useful in Windows 7. Launch StikyNot.exe and you can type notes at the keyboard; right-click a note to change its colour; click the + sign on the note title bar to add another note; and click a note and press Alt + 4 to close the note windows.
RSS-powered Windows 7 desktop slideshowsRSS-powered Windows 7 desktop slideshows
Now have the power to change your desktop via RSS feeds, click here to see how to do it
Windows 7 supports several useful new keyboard shortcuts.
Display/ hide the Explorer preview pane
Display gadgets in front of other windows
Windows Logo++ (plus key)
Zoom in, where appropriate
Windows Logo+- (minus key)
Zoom out, where appropriate
Maximise the current window
Minimise the current window
Snap to the left hand side of the screen
Snap to the right hand side of the screen
Minimise/ restore everything except the current window
An excellent command-line robocopy tool with new switches introduced with Windows 7. Check out, /MT, can improve speed by carrying out multi-threaded copies with the number of threads you specify. Enter robocopy /? at a command line for the full details.