public override void Publish(string dbconnection, string data, bool sample, string strategy = SqlDbConfiguration.SqlAzureExecutionStrategy)
		{
			base.Publish(dbconnection, data, sample, strategy);
			string connection = dbconnection;
			SafeWriteDebug("ConnectionString: " + connection);

			using (var db = new EFMarketingRepository(connection))
			{
                if (sample)
                {
                    new SqlPromotionDatabaseInitializer().InitializeDatabase(db);
                }
                else
                {
                    new SetupMigrateDatabaseToLatestVersion<EFMarketingRepository, m.Promotion.Configuration>().InitializeDatabase(db);
                }
			}

			using (var db = new EFDynamicContentRepository(connection))
			{
				if (sample)
				{
					new SqlDynamicContentSampleDatabaseInitializer().InitializeDatabase(db);
				}
				else
				{
                    new SqlDynamicContentDatabaseInitializer().InitializeDatabase(db);
				}
			}
		}
        public void Run_dynamiccontent_performance()
        {
            var repository = new EFDynamicContentRepository();
            var cache = new HttpCacheRepository();
            var evaluator = new DynamicContentEvaluator(repository, null, cache);
            var service = new DynamicContentService(repository, evaluator);

            DynamicContentConfiguration.Instance.Cache.IsEnabled = true;

            var tags = new TagSet();
            tags.Add("CategoryId", new Tag("VendorVirtual"));
            tags.Add("StoreId", new Tag("SampleStore"));
            tags.Add("CurrentUrl", new Tag("http://localhost/store"));

            var items = service.GetItems("HomeMain", DateTime.Now, tags);
            //items = service.GetItems("HomeMain", DateTime.Now, tags);
        }
		public void Dispose()
		{
			try
			{
				// Ensure LocalDb databases are deleted after use so that LocalDb doesn't throw if
				// the temp location in which they are stored is later cleaned.
				using (var context = new EFDynamicContentRepository(_databaseName))
				{
					context.Database.Delete();
				}

                if (_service != null)
                {
                    _service.Dispose();
                }

			}
			finally
			{
				AppDomain.CurrentDomain.SetData("DataDirectory", _previousDataDirectory);
			}
		}