Switch from 'Entity Framework Linq' to 'Linq to Objects' with AsEnumerable

Most people know what when writing a Linq query with Entity Framework that until that query is enumerated it won't call out to the database. Sometimes it's necessary to do some more work with the results such as use a method as part of the projection. This is where comes in…

Using ProviderName to get the database connection

When setting your connection string in a .NET config file you can make use of the attribute by using and passing it the provider name.

Entity Framework and Foreign key constraint may cause cycles or multiple cascade paths

Today I ran into the issue for the first time. The first thing to note is the error isn't actually from Entity Framework it's from SQL Server. I was however using EF5 Code First so I fist needed to figure out why my model was giving me back this error. The error message itself…

Ninject and Singletons in the WebAPI with Scopes

The new Activation Blocks in Ninject are great for automatically resolving dependencies in the request scope. However they suffer from one flaw which is they don't respect Constant or Singletons in fact they ignore the scope completely! In my application I needed a reference my…

Silverlight Page Transition Complete Event

While creating a mixed silverlight and xna WP7 application I started to add in page transitions with the silverlight toolkit. For the silverlight part of the application they work perfectly however when transitioning to the game screen the animation was not present. This is…

SharePoint WebConfig Modifications

Example for adding or removing a webconfig modification in SharePoint 2010. Usage:

Inheriting SharePoint masterpages with Powershell

If you want your subsites to inherit their masterpages from their parents the first thing you need to know is the difference between normal sites and publishing sites: Only publishing sites actually support inheriting masterpages. If you're site is not a publishing site you have…

If you are going to do something, do it right

I love this quote and I think it really fits in with what I'm doing with this blog, and in my everyday life. Taking pride in your work is the only way to ensure that it's as good as it can be. Every day I like to feel that things are better than when I started. It's oftern the…

Physics for games

I'm revisiting a lot of the physics and I predict trigonometry that was once a daily part of my life before graduating university. I'm surprised by how much I'd forgotten and writing it down always helps you remember it. Especially when it's on a blog and you can search for it…

WP7 Mango Unit Testing Framework "Cannot find a Resource with the Name/Key typeNameConverter"

When trying to setup unit testing I was slightly dissapoited you couldn't test a silverlight library using a normal test project. However you can use the testing framework by using the Silverlight 3 libraries here. However you have to make sure you get the right version. I didn't…