I also noticed that the database install script runs more than once if an install fails and you try again. As a result some tables had the same rows inserted more than once. This is a major issue the way the code was written. When you do .Single but didn't pass in a primary key you get a runtime error. It should be .FirstOrDefault