Acme.Northwind.Install.SqlServers.RunEmbeddedFile C# (CSharp) Method

RunEmbeddedFile() public static method

public static RunEmbeddedFile ( SqlConnection connection, SqlTransaction transaction, string resourceFileName, string>.List failedScripts, List successOrderScripts, IEnumerable skipSections, List _databaseItems, List _currentItems ) : void
connection System.Data.SqlClient.SqlConnection
transaction System.Data.SqlClient.SqlTransaction
resourceFileName string
failedScripts string>.List
successOrderScripts List
skipSections IEnumerable
_databaseItems List
_currentItems List
return void
		public static void RunEmbeddedFile(SqlConnection connection, SqlTransaction transaction, string resourceFileName, List<KeyValuePair<Guid, string>> failedScripts, List<Guid> successOrderScripts, IEnumerable<string> skipSections, List<nHydrateDbObject> _databaseItems, List<nHydrateDbObject> _currentItems)
		{
			var tempFolder = string.Empty;
			var scripts = ReadSQLFileSectionsFromResource(resourceFileName, skipSections);
			System.Diagnostics.Debug.WriteLine(System.DateTime.Now.ToString("HH:mm:ss.ff") + " - Run embedded file: " + resourceFileName);

			#region Load script hashes
			//var runScript = false;
			var current = _databaseItems.FirstOrDefault(x => x.name.ToLower() == resourceFileName.ToLower());
			var hashValue = string.Join("|", scripts).CalculateMD5Hash();

			if (current != null)
			{
				if (current.Hash != hashValue)
				{
					//runScript = true;
					current.ModifiedDate = DateTime.Now;
					_currentItems.RemoveAll(x => x.name.ToLower() == current.name.ToLower());
					_currentItems.Add(current);
					current.Hash = hashValue;
				}
			}
			else
			{
				//runScript = true;
				current = new nHydrateDbObject()
				{
					name = resourceFileName,
					Hash = hashValue,
					ModelKey = new Guid(UpgradeInstaller.MODELKEY),
					type = "FILE",
				};
				_currentItems.Add(current);
			}
			#endregion

			//if (runScript)
			{
				foreach (var sql in scripts)
				{
					ExecuteSQL(connection, transaction, sql, failedScripts, successOrderScripts);
				}
			}
		}

Same methods

SqlServers::RunEmbeddedFile ( SqlConnection connection, SqlTransaction transaction, string resourceFileName, string>.List failedScripts, List _databaseItems, List _currentItems ) : void
SqlServers::RunEmbeddedFile ( SqlConnection connection, SqlTransaction transaction, string resourceFileName, List _databaseItems, List _currentItems ) : void