本文整理汇总了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);
}
示例2: ExecuteWith
public override void ExecuteWith( IMigrationProcessor processor )
{
string sqlText;
using (var reader = File.OpenText(SqlScript))
sqlText = reader.ReadToEnd();
processor.Execute(sqlText);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例7: ExecuteWith
public override void ExecuteWith(IMigrationProcessor processor)
{
processor.Execute(SqlStatement);
}