Quick Tip: Manually Run EF Migrations on External Databases

Entity Framework migrations are a great thing. They’ve made my development life a LOT easier. Automated migrations can cause problems, especially on a project with multiple developers involved. For that, we use manual migrations through the Package Manager Console.

But how do you manually run these migrations against your test (or live) server when your deployment tool doesn’t run them? If you have access to the database in question, you can add the ConnectionString and ProviderName parameters at the Package Manager Console prompt and make life a lot easier:

Update-Database -ConnectionString "MY_CONNECTION_STRING" -ConnectionProviderName "System.Data.SqlClient"

You can pull your connection string direct from your web.config transform, no special “magic” needed.

Enjoy! Continue reading “Quick Tip: Manually Run EF Migrations on External Databases”


Installing SiteFinity with IIS 8, SQL Server 2012, and Windows Server 2012

I’m working on a new project that uses the Sitefinity CMS by Telerik. So far I’ve been impressed with the architecture and features it provides. The documentation is robust and there is good support. I did run into a couple of snags installing a new Sitefinity instance on an Azure VM that is running Windows Server 2012, IIS 8, and SQL Server Express 2012. Here are a few tweaks you’ll need to make to get an install working.

Continue reading “Installing SiteFinity with IIS 8, SQL Server 2012, and Windows Server 2012”


Code Analysis: The Hot Sauce Test

Oftentimes I am called into a project that is adding new features to an existing application. While a lot of updates seem easy on the surface (I’m just adding a basic page that saves the user’s e-mail address), the underlying architecture of the system can make this rather complex. The shocking thing is that a lot of times the complexity isn’t immediatley discoverable. To help identify and estimate the work needed for a new feature, I’ve devised what I like to call “the hot sauce test.”

Continue reading “Code Analysis: The Hot Sauce Test”

Matrix Code Tunnel

Refactored: Creating dynamic/configurable parameterized queries in Entity Framework

A little while back I posted about a technique I was using to setup parameterized queries using Entity Framework. I had posted to the .Net group on Google+ and received some amazing feed back from Dan Nemec and Chris McCall and refactored the code. It’s cleaner, easier to work with, and hopefully a bit more optimized too. Here’s what’s different. Continue reading “Refactored: Creating dynamic/configurable parameterized queries in Entity Framework”

Computer Code

Creating dynamic/configurable parameterized queries in Entity Framework

EDIT: A better, refactored version of this can be found here.

Entity Framework is an amazing tool. It allows you to quickly and easily get your basic queries and updates running with little hassle. In addition, you have business objects to interact with, which makes your middle tier (or your controller) that much easier to work with. However, when you need to start setting up more dynamic queries from user input, things start to get tricky. Here’s a solution I created to help with that. Continue reading “Creating dynamic/configurable parameterized queries in Entity Framework”