Monday, 30 March 2015

Emailing support

A while back I was working with a colleague and we ran into an issue that required us to email a company for support.

My colleague expressed an interest in how I went about structuring the email and asked if I could write up my process for them, hence this blog post.


The way I structure any of my mails, to support or otherwise, is along the lines of:

  • Explaining reason for the email
  • Provide any information I may have on subject
  • If asking for something clearly state what I need/would like

In addition if I am able to provide anything to help, such as test project with failing tests, they should be attached or easily accessed.

One of the additional things that I take into account when writing an email for support is thinking “what would I need to help


Below is an example email written about a problem with a fictitious component aBxZ:

Hi Support,

Here at we are using your aBxZ component and are concerned about the number of duplicate calls it is making to the api and can see no way to stop this.

We have been using Fiddler to profile aBxZ’s behaviour on our QA environment whilst testing with a similar load to our production environment and have attached the data we captured.

If you look at the captured sessions you’ll see that aBxZ makes a call to for every request, this is happening even when we don’t call aBxZ explicitly.

We read the documentation and ensured that we have followed the instructions and guidance on how to use aBxZ and we posted on StackOverflow about it but nobody was able to provide a solution.

We managed to replicate the behaviour in a test project, which is attached, and it appears to be happening when aBxZ is instantiated.

Please can you let us know:

  1. Are we using the component correctly?
  2. If using it correctly is there anything we can do to stop this?
  3. If it is a bug with aBxZ when you think you might have a patch/fix

If we should be doing something different to what we do currently please could you alter the attached test project and send it back to us.

Looking forward to your reply

Analysis of the email

Looking at the mail it follows my structure and breaks down like this:

  • Paragraph 1, say who we are and what the problem is
  • Paragraphs 2 – 5 provide details about what has been tried and provide to them additional information in form of captured fiddler sessions and a test project
  • Paragraphs 6 & 7 ask, hopefully as clearly as possible, for help to resolve the issue.


Hopefully this is of use to you, for me it seems to be very clear but I’d be interested to hear from other people how they structure their emails and if you think I’m missed something out.

Thursday, 26 March 2015

Simple.Data Asp.Net Identity Provider

ASP.Net Identity is Microsoft's latest implementation of a membership and identity service which will replace ASP.Net Membership, SimpleMembership and Universal Membership.

The out of the box implementation of ASP.Net Identity is, unsurprisingly, coupled to Entity Framework (EF) which means if you do want to use the new identity functionality but your app doesn’t use EF for data access you either end up having to include it in your project anyway or not use Identity.


On a project I was part of towards the end of last year we ran into this exact problem, we were using Simple.Data for data access but wanted to use the new features of Identity.

One of the advantages of identity over previous membership implementations is that it is possible to provide a different data access layer allowing you to use the database you want but keep the rest of the functionality provided by identity e.g. password encryption, OAuth, etc

The advantage of using Simple.Data is that you aren’t limited to connecting to any one database as you simply include the relevant provider for the database you want to use (if it is supported).

The Provider

The result is a Simple.Data provider for ASP.Net Identity which should be able to dropped into an existing application using EF with little to no change.

You can install it from Nuget using the package manager console with the following command:

PM> Install-Package Simple.Data.AspNet.Identity

If you prefer to use the “Manage Nuget Packages” GUI it is easiest to search for Simple.Data:


If you want to just look at the code or feel like building it from code yourself the repo on GitHub can be found here.


There are a few limitations with this implementation that its worth knowing about:

  • Due to ASP.Net Identity being designed around generics you must use concrete classes with it, you cannot use dynamic.  To help the provider comes with 2 classes IdentityUser and IdentityRole classes for you to use.
  • Database tables – currently you need to use database tables that match the IdentityUser and IdentityRole classes although they don’t have to be named the same.  The Nuget package includes a script for Sql Server to create these tables.
  • Relies on referential integrity – when deleting data ASP.Net Provider does delete any data that may be effected, instead it relies on db referential integrity to clean up linked records.
  • Ids stored as strings – although ids for users, roles, etc are generated as Guids they are stored as strings, this mimics the standard EF model.
  • No IQueryable support – Simple.Data doesn’t support IQueryable this means that the Users property on UserStore and Roles property on RoleStore will throw not implemented exceptions.  If you need to query Users and Roles you need to do that yourself
  • Only works with Simple.Data v1 – a version is coming for Simple.Data v2 (which supports async await) but this is still a work in progress.
  • Db Connection – the provider supports using Simple.Data default connection or a named connection, it currently doesn’t support taking a connection string directly.

Although you need to use the identity classes in the provider you can inherit from them just like the EF code.


To try and make it as easy as possible to get started with this provider I have built 2 sample applications based off of the normal MVC project template:

  1. MVC 5 Standard Sample – this is the standard MVC project template the only change is that it uses Simple.Data for data access.
  2. MVC 5 Sample – this sample is an extension of the standard sample as it includes using roles with identity to be able to control access to pages of your web application

The easiest way to work with these samples is:

  1. Create new ASP.Net Web application
  2. Select the Empty project template
  3. Once the project has been created add the appropriate Nuget package

If you want the standard sample then at the package manager console type:

PM > Install-Package Simple.Data.AspNet.Identity.MVC5.Standard.Sample

Or if you want the sample that includes roles:

PM> Install-Package Simple.Data.AspNet.Identity.MVC5.Sample

When you install these packages you will have all the necessary classes and references added to your project and it will create a database in localDb so you should be able to build and run the code to start working with it immediately.

Both sample projects are in one repo which you can find here if you wish to play with the code that creates the samples although installing the Nuget package is by far the easiest way to get working with the code.

The future

This version is 1.0.0, it is stable and should work without problems (taking limitations mentioned into account).

Going forward there are several improvements that I intend to make:

  • Simple.Data v2 – complete work on this implementation
  • Support connection strings – to match normal Simple.Data connection options add the ability to be passed a connection string.
  • Support different id variable types – normal ASP.Net Identity allows for different variable types for ids via more generics, I’m looking to add this in.
  • Automated builds – looking to use AppVeyor to build and test the code
  • Automate Nuget publishing – once AppVeyor is building the code look to automate generation and publishing of the Nuget packages
  • More samples – add samples showing use of the provider in different ways e.g. not tied to Owin context


This provider should make it easy for people that wish to use ASP.Net Identity with Simple.Data right now.

With the planned future improvements the additional functionality will bring it up to parity with the full EF model.

Tuesday, 24 February 2015

Node School–Bristol

Last Saturday I got to attend the first NodeSchool to be held in Bristol.

The event was held at the MixRadio offices in the heart of Bristol who were sponsoring the day by hosting the event, the room was at the top of their building looking out over Bristol which was brilliant.

The Day

I, like most attendees, started arriving about 9:15 finding somewhere to sit and getting their laptop ready.

Just after 10 the event began with an introduction telling us all about the day, what we could expect, how to get help and thanks to the sponsors that had made the day possible.

The format for the day was to follow the tutorials in the learnyounode workshop from NodeSchool (which you can install using npm install –g learnyounode) the difference being that instead of having to do it on your own, and try and complete the exercises simply by Googling for solutions, there were “mentors” on hand to help if you got stuck.  The mentors were volunteers who had experience with node and could help solve the exercises in the workshop.

The original timetable for the day had attendees having a break at 11 but most people were heads down working on the exercises with mentors helping out as required.

Lunch was supplied by JustEat, who were also sponsoring the event, who provided some awesome pizza for everyone to eat.

After lunch there was a short update on what the plan was for the afternoon and other tutorials that you could look at before we carried on with the exercises.

At 4:30 we stopped for a talk from Adam Butler on “5 Things to build with NodeJS” the highlight of which was Adam flying a couple of different drones using node.

After the event there people went for drinks at Big Chill which unfortunately I wasn’t able to attend.

The workshop/exercises

The learnyounode workshop code is structured into a series of exercises that take you from “Hello World!” through multiple async http calls to creating your own http server.

Everything is done at the command line with learnyounode providing a list of all the exercises and marking each as completed when you successfully complete an exercise.

When you start an exercise you get told what it is you need to do and then get a “Hint” giving you more information about how to accomplish what it is you need to do, once you’ve written your solution you verify its correct using the learnyounode inbuilt test harness. 

If your code doesn’t pass the test you get test failure output showing what was expected and if you pass you get shown the “official” solution to the problem.

My Day

During the day I managed to complete the entire workshop, which was the intention for everybody.

I also managed to complete the Express workshop, ExpressWorks, and what was interesting (to me at least) was how noticeably easier it was to use node with a framework like express after having had to code at the lower level for most of the day. 


It was a really good day in a fantastic venue, we were fed watered and looked after really well throughout the day, I must give a big thanks to Katja ,Tristan, Tom & Adam for organising the day.

Although I wouldn’t say I’m now a proficient node developer I feel I have a much better idea of how node works and also through doing the Express workshop can see how easy it would be to put  together an application on node.

I know that they are planning future events and I would recommend attending one if you want to explore the world of node but were unsure where to start.

Friday, 9 January 2015

2014 in review

Just like previous years I’m blogging a little review/retrospective on what I got up to last year, what goals (if any) I managed to achieve and what plans I have for the year ahead.

2014 Goals

As I did so badly in 2013 with my goals I changed tack for 2014 with only 3 main goals:

  • JavaScript/SPA
  • Code
  • Blog

Friday, 31 October 2014

Log Parser Lizard creating custom regex format

I first heard about Log Parser Lizard (LPL) when Scot Hanselman blogged about it back in 2011 and since then its been part of my tool belt.

LPL makes analysing logs easy enabling you to point it at single log file, or even a directory of files, it will parse them and then allow you to query the data using SQL syntax.

LPL comes with a lot of predefined searches from Active Directory, IIS, event logs, etc and has the ability to allow you to define your own custom RegEx format for parsing text files.

Recently I needed to use the custom RegEx format, its not the easiest thing to do and as I couldn’t find any examples I thought I’d write up what I did to help me, and possibly anybody else that needs to do it, in the future.

Log Parser Lizard creating custom regex format

I first heard about Log Parser Lizard (LPL) when Scot Hanselman blogged about it back in 2011 and since then its been part of my tool belt.

LPL makes analysing logs easy enabling you to point it at single log file, or even a directory of files, it will parse them and then allow you to query the data using SQL syntax.

LPL comes with a lot of predefined searches from Active Directory, IIS, event logs, etc and has the ability to allow you to define your own custom RegEx format for parsing text files.

Recently I needed to use the custom RegEx format, its not the easiest thing to do and as I couldn’t find any examples I thought I’d write up what I did to help me, and possibly anybody else that needs to do it, in the future.

Wednesday, 23 July 2014

The Full Stack Developer

Back in 2010 Carlos Bueno wrote a blog post on The Full Stack Developer and since then there have been various posts that comment on it such as this post and this post which made the full stack developer seem an impossibility.

I’m not sure I buy into this idea of a Full Stack Developer as somebody who can for example throw together a web site using the latest framework/library, work at the TCP protocol level and understand i/o bottlenecks in a database system with any degree of mastery.

Whilst there are some extraordinary individuals out there that can manage this I doubt the majority of developers today can do so.

We as developers have, out of necessity, become specialists in specific areas of computing.

The rate of change, number of languages/tools/frameworks/libraries and depth of understanding required means that in general people simply don’t have the time to be able to keep up with all the changes to all the various areas of computing.

Monday, 21 July 2014

Grunt & Gulp – an overview

Furthering my journey into JavaScript up to now I have not had much interaction with JS task/build systems so to remedy that I recently attended a DoLess workshop on Grunt & Gulp to discover what they were all about.

Most often people associate both Grunt & Gulp with building systems but they are not restrict to that and both can form part of the of a front end dev’s day to day development process being able to run tests & reload html when altered, etc