The digital home of Richard Garside

This is my digital home, a resting place for my personal and client projects. I'm a web developer based in Leeds. I specialise in .NET MVC and apps for Windows 8 and Mac. You can find out more about me here.

Recent stuff from my blog

  • Top Ten Windows 8 Apps

    The Creative Bloq App Generator Contest was sponsored by Windows 8 and was a chance for UK developers to be recognised for their excellent work. I was very pleased that my app Font Picker was one of the top ten winners, particularly because of the high quality of the other winners. Here are the all the winners of the contest.

    Grand Prize Winner

    Didlr – Rich Holdsworth

    Didlr lets you draw and share your pictures.

    Top ten prize winners

    These are in no particular order, except I'm biased so mine is at the top.

    Font Picker – Richard Garside

    Font Picker is an app for designers … more

    4 Comments
  • Custom XML model binder for ASP.NET MVC

    In an earlier post I wrote about using an XML value provider to allow you to send XML to your .NET MVC action methods. This is great, untill you want to accept XML where you have a model that needs XML atributes to control how it's deserialized. As the value provider stage happens before mondel binding it has no knowledge of the model objects that the values will be pushed into. So it can't look at your model class's XML attributes.

    In cases like this, you're better of using a custom XML model binder.

    To setup an XML model binder you need to create a model binder and a model binder provider. … more

  • Mocking with NSubstitute

    My previous C# mocking framework of choice was MOQ. It's very powerful and fairly easy to use, but I recently started using NSubstitute and fell in love with how easy and intuative it was to use.

    The cleverest part is that unlike MOQ the mocks produced actually implement the interface they're mocking and this makes the code much clearer and a little bit shorter.

    Here is a very simple example:

    var mockThing = Substitute.For<IThing>();mockThing.DoThingy().Returns("Something");// Use mock thingUseThing(mockThing);

    In MOQ this is also quite straightforward but the setup code to change … more