当前位置: 首页>>代码示例>>C#>>正文


C# IMigrationProcessor.Execute方法代码示例

本文整理汇总了C#中IMigrationProcessor.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# IMigrationProcessor.Execute方法的具体用法?C# IMigrationProcessor.Execute怎么用?C# IMigrationProcessor.Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMigrationProcessor的用法示例。


在下文中一共展示了IMigrationProcessor.Execute方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExecuteWith

 public override void ExecuteWith(IMigrationProcessor processor)
 {
     // since all the Processors are using String.Format() in their Execute method
     //  we need to escape the brackets with double brackets or else it throws an incorrect format error on the String.Format call
     var sqlText = SqlStatement.Replace("{", "{{").Replace("}", "}}");
     processor.Execute(sqlText);
 }
开发者ID:BarsBarsovich,项目名称:fluentmigrator,代码行数:7,代码来源:ExecuteSqlStatementExpression.cs

示例2: ExecuteWith

        public override void ExecuteWith( IMigrationProcessor processor )
        {
            string sqlText;
            using (var reader = File.OpenText(SqlScript))
                sqlText = reader.ReadToEnd();

            processor.Execute(sqlText);
        }
开发者ID:rtw,项目名称:fluentmigrator,代码行数:8,代码来源:ExecuteSqlScriptExpression.cs

示例3: ExecuteWith

        public override void ExecuteWith( IMigrationProcessor processor )
        {
            string sqlText;
            using (var reader = File.OpenText(SqlScript))
                sqlText = reader.ReadToEnd();

            // since all the Processors are using String.Format() in their Execute method
            //  we need to escape the brackets with double brackets or else it throws an incorrect format error on the String.Format call
            sqlText = sqlText.Replace("{", "{{").Replace("}", "}}");
            processor.Execute(sqlText);
        }
开发者ID:remids,项目名称:fluentmigrator,代码行数:11,代码来源:ExecuteSqlScriptExpression.cs

示例4: ExecuteWith

        public override void ExecuteWith(IMigrationProcessor processor)
        {
            string sqlText;
            string embeddedResourceName = GetQualifiedResourcePath();

            using (var stream = MigrationAssembly.GetManifestResourceStream(embeddedResourceName))
            using (var reader = new StreamReader(stream))
            {
                sqlText = reader.ReadToEnd();
            }

            // since all the Processors are using String.Format() in their Execute method
            //  we need to escape the brackets with double brackets or else it throws an incorrect format error on the String.Format call
            sqlText = sqlText.Replace("{", "{{").Replace("}", "}}");
            processor.Execute(sqlText);
        }
开发者ID:remids,项目名称:fluentmigrator,代码行数:16,代码来源:ExecuteEmbeddedSqlScriptExpression.cs

示例5: ExecuteWith

        public override void ExecuteWith(IMigrationProcessor processor)
        {
            string sqlText;
            string embeddedResourceName = GetQualifiedResourcePath(SqlScript);

            if (string.IsNullOrEmpty(embeddedResourceName))
            {
                throw new ArgumentNullException(string.Format("Could find resource named {0} in assembly {1}",SqlScript,MigrationAssembly.FullName));
            }

            using (var stream = MigrationAssembly.GetManifestResourceStream(embeddedResourceName))
            {
                using (var reader = new StreamReader(stream))
                {
                    sqlText = reader.ReadToEnd();
                }
            }

            processor.Execute(sqlText);
        }
开发者ID:timscott,项目名称:fluentmigrator,代码行数:20,代码来源:ExecuteEmbeddedSqlScriptExpression.cs

示例6: ExecuteWith

        public override void ExecuteWith(IMigrationProcessor processor)
        {
            string sqlText;
            using (var reader = File.OpenText(SqlScript))
                sqlText = reader.ReadToEnd();

            // since all the Processors are using String.Format() in their Execute method
            //	1) we need to escape the brackets with double brackets or else it throws an incorrect format error on the String.Format call
            //	2) we need to replace tokens
            //	3) we need to replace escaped tokens
            sqlText = Regex.Replace(
                Regex.Replace(
                    sqlText.Replace("{", "{{").Replace("}", "}}"),
                    @"\$\((?<token>\w+)\)",
                    m => ((Parameters != null) && Parameters.ContainsKey(m.Groups["token"].Value))
                        ? Parameters[m.Groups["token"].Value]
                        : ""),
                @"\${2}\({2}(?<token>\w+)\){2}",
                m => string.Format("$({0})", m.Groups["token"]));

            // adding ability to pass parameters to execute function
            processor.Execute(sqlText);
        }
开发者ID:zendever,项目名称:fluentmigrator,代码行数:23,代码来源:ExecuteSqlScriptExpression.cs

示例7: ExecuteWith

 public override void ExecuteWith(IMigrationProcessor processor)
 {
     processor.Execute(SqlStatement);
 }
开发者ID:rtw,项目名称:fluentmigrator,代码行数:4,代码来源:ExecuteSqlStatementExpression.cs


注:本文中的IMigrationProcessor.Execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。