public void Dispose()
        {
            VariableMapping.TryCatch(p => p.Clear());
            PropertiesMapping.TryCatch(p => p.Clear());

            VariableMapping   = null;
            PropertiesMapping = null;
        }
Exemplo n.º 2
0
        public string ReplaceVariables(string script)
        {
            foreach (IEnumerable <VariableMapping> mapping in this.variableMappings)
            {
                VariableMapping sourceVariable = mapping.FirstOrDefault(item => item.DbType == this.sourceDbInterpreter.DatabaseType.ToString());
                VariableMapping targetVariable = mapping.FirstOrDefault(item => item.DbType == this.targetDbInterpreter.DatabaseType.ToString());

                if (sourceVariable != null && !string.IsNullOrEmpty(sourceVariable.Variable) && targetVariable.Variable != null && !string.IsNullOrEmpty(targetVariable.Variable))
                {
                    script = this.ReplaceValue(script, sourceVariable.Variable, targetVariable.Variable);
                }
            }

            return(script);
        }