public static void AddSqlDependency(this IDbCommand command, Action<SqlNotificationEventArgs> callback)
{
var sqlCommand = command as SqlCommand;
if (sqlCommand == null)
{
throw new NotSupportedException();
}
var dependency = new SqlDependency(sqlCommand, null, (int)_dependencyTimeout.TotalSeconds);
dependency.OnChange += (o, e) => callback(e);
}