Posts

Showing posts from January, 2011

MVC 3 Unobtrusive Validation with LINQ to SQL

Recently I've been working on a small project that uses LINQ to SQL as it's data layer (it's a very simple model) and contains two presentation projects - a web form application for the front end and an MVC 3 administration panel.

When playing with the unobtrusive validation engine, you'll find many examples on the 'net telling you to decorate your model with various attributes from the System.ComponentModel.DataAnnotations namespace. Now, I ran in to a bit of an issue with the LINQ to SQL objects - they're generated dynamically. I could add the attributes, but they would be overwritten any time I made a change to my DBML file. So, after a bit of searching I came across the MetaDataTypeAttribute in the same namespace. This attribute allows you to create a completely separate, standard class and define it as a Meta Data container for another class. Neat, hu?
Well, I quickly ran in to my second issue - I could create my separate class, but I still had to tag the …

The human condition

Image
People often complain that contractors get paid too much, whilst they seem to do the same job as permanent developers. As one of those dirty contractors myself, I obviously have a different view on the subject, and via the medium of my blog I would like to attempt to clarify the differences the way I see it.

Technology

In order to be a successful contractor (or consultant, as I prefer to call myself), you have to be "current". By current, I mean you have to stay up to speed with the latest technologies in your particular field. If you're a fellow .Net developer, I'm sure you're aware that Microsoft are always releasing new software platforms, plug-ins and technologies. Only last week MVC 3 was released and with it a plethora of new development tools. Even if you've landed a contract that could take up the next few years of your working life, by the time you've finished there 43 new versions of Internet Explorer will have been released, and the trendy .Net …

A slave to the game

Image
Unfortunately (for me) I have a condition whereby I must do every task outstanding before I allow myself to relax at the end of a night, so I rarely feel like I've earned the privilege to play a game or two. This weekend I managed to get some spare time to jump on the old Xbox 360 and crack on with a few of the titles I have stacked up on top of my console cabinet, namely Enslaved and Dragon Age: Origins, interspersed with a few matches of COD: Black Ops.

I bought Enslaved back in October the day it came out, and played quite a bit of it back then. Unfortunately I had to halt game play due to work commitments (the story of my life). Anyway - I jumped back on this Saturday to "finish up" and shortly realised I was only one level from the end. Suffice to say, I wasn't playing it very long.

The game as a whole was more of a cinematic experience than a game - the voice acting, visuals and story were all very good, but the game play was rather generic. This is the second …

Web Platform Installer WebMatrix hanging when installing SQL Server System CLR Types

Image
Last Friday I smoothly installed MVC 3 via the Microsoft Web Platform Installer. Having not used it before, I was impressed... it was quick and easy, though I did get a few reference related errors in Visual Studio shortly afterwards. Regardless, I decided to have a look at the other packages on offer. After reading a few posts on Scott Hanselman's blog, I skipped off on my merry way towards the WebMatrix package, so I could have a play with the new Razor engine with standard ASP.Net pages.

Unfortunately when selecting WebMatrix, the Web Platform Installer seems to hang on the first step (SQL Server System CLR Types [Step 1 of 5]):


I've tried it a few times - rebooting, closing all applications / non essential services etc, but nothing seems to help. After a little bit of digging, I figured out that the WPI keeps log files in the following directory:

C:\Documents and Settings\[USERNAME]\Local Settings\Application Data\Microsoft\Web Platform Installer\logs

One file in particula…

Kinecting people

I was one of the lucky geeks to wake up on Christmas morning and open my brand new Xbox Kinect. After 20 minutes of reorganising my games room (consisting of balancing the sofa precariously on it's end and pushing it around the room until it was away from flailing limbs), I was ready to go...

Let me just say that I've been meaning to get myself a Kinect since the day it came out... but (as always) I've been so busy with work that I've not even had the time to play the plethora of new games stacked on my console cabinet, let alone increasing my gaming responsibility by buying a Kinect. Suffice to say it was not a priority for the later part of 2010. It was inevitable I would get hands on one of these sooner rather than later, but Mrs Spikeh gladly obliged in my geeky Christmas box :)
So once it was plugged in, I went ahead with the calibration process, which turned out to be pretty easy; Step here, raise your arms, step there, pose like an antelope making love to an octop…