本文整理汇总了C#中IMigrationProcessor类的典型用法代码示例。如果您正苦于以下问题:C# IMigrationProcessor类的具体用法?C# IMigrationProcessor怎么用?C# IMigrationProcessor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IMigrationProcessor类属于命名空间,在下文中一共展示了IMigrationProcessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransactionalMigrationScope
public TransactionalMigrationScope(IMigrationProcessor migrationProcessor, Action disposalAction)
: base(disposalAction)
{
if (migrationProcessor == null) throw new ArgumentNullException("migrationProcessor");
_migrationProcessor = migrationProcessor;
_migrationProcessor.BeginTransaction();
}
示例2: MigrationRunner
public MigrationRunner(IAssemblyCollection assemblies, IRunnerContext runnerContext, IMigrationProcessor processor)
{
_migrationAssemblies = assemblies;
_announcer = runnerContext.Announcer;
Processor = processor;
_stopWatch = runnerContext.StopWatch;
RunnerContext = runnerContext;
SilentlyFail = false;
CaughtExceptions = null;
Conventions = new MigrationConventions();
if (!string.IsNullOrEmpty(runnerContext.WorkingDirectory))
Conventions.GetWorkingDirectory = () => runnerContext.WorkingDirectory;
_migrationScopeHandler = new MigrationScopeHandler(Processor);
_migrationValidator = new MigrationValidator(_announcer, Conventions);
MigrationLoader = new DefaultMigrationInformationLoader(Conventions, _migrationAssemblies, runnerContext.Namespace, runnerContext.NestedNamespaces, runnerContext.Tags);
ProfileLoader = new ProfileLoader(runnerContext, this, Conventions);
MaintenanceLoader = new MaintenanceLoader(_migrationAssemblies, runnerContext.Tags, Conventions);
if (runnerContext.NoConnection){
VersionLoader = new ConnectionlessVersionLoader(this, _migrationAssemblies, Conventions, runnerContext.StartVersion, runnerContext.Version);
}
else{
VersionLoader = new VersionLoader(this, _migrationAssemblies, Conventions);
}
}
示例3: MigrationRunner
public MigrationRunner(Assembly assembly, IRunnerContext runnerContext, IMigrationProcessor processor)
: this(new List<MigrationAssemblyInfo>() { new MigrationAssemblyInfo() { Assembly = assembly , Namespace = runnerContext.Namespace} },
runnerContext,
processor,
false)
{
}
示例4: 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);
}
示例5: ExecuteWith
public override void ExecuteWith( IMigrationProcessor processor )
{
string sqlText;
using (var reader = File.OpenText(SqlScript))
sqlText = reader.ReadToEnd();
processor.Execute(sqlText);
}
示例6: MigrationContext
public MigrationContext(IMigrationConventions conventions, IMigrationProcessor migrationProcessor, Assembly migrationAssembly)
{
Conventions = conventions;
Expressions = new List<IMigrationExpression>();
QuerySchema = migrationProcessor;
PreviewOnly = migrationProcessor.Options.PreviewOnly;
MigrationAssembly = migrationAssembly;
}
示例7: MigrationRunner
public MigrationRunner(IMigrationConventions conventions, IMigrationProcessor processor, IAnnouncer announcer, IStopWatch stopWatch)
{
_announcer = announcer;
SilentlyFail = false;
CaughtExceptions = null;
Conventions = conventions;
Processor = processor;
_stopWatch = stopWatch;
}
示例8: MigrationVersionRunner
public MigrationVersionRunner(IMigrationConventions conventions, IMigrationProcessor processor, IMigrationLoader loader, Assembly assembly, string @namespace)
{
_migrationConventions = conventions;
_migrationProcessor = processor;
_migrationAssembly = assembly;
_migrationLoader = loader;
_namespace = @namespace;
_migrationRunner = new MigrationRunner(conventions, processor);
_versionMigration = new VersionMigration();
}
示例9: 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);
}
示例10: MigrationVersionRunner
public MigrationVersionRunner(IMigrationConventions conventions, IMigrationProcessor processor, IMigrationLoader loader, Assembly assembly, string @namespace, IAnnouncer announcer)
{
_migrationConventions = conventions;
_migrationProcessor = processor;
_migrationAssembly = assembly;
_migrationLoader = loader;
_namespace = @namespace;
_announcer = announcer;
_migrationRunner = new MigrationRunner(conventions, processor, announcer, new StopWatch());
_versionTableMetaData = loader.GetVersionTableMetaData(assembly);
_versionMigration = new VersionMigration(_versionTableMetaData);
}
示例11: 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);
}
示例12: MigrationRunner
public MigrationRunner(Assembly assembly, IRunnerContext runnerContext, IMigrationProcessor processor)
{
_migrationAssembly = assembly;
_announcer = runnerContext.Announcer;
Processor = processor;
_stopWatch = runnerContext.StopWatch;
SilentlyFail = false;
CaughtExceptions = null;
Conventions = new MigrationConventions();
if (!string.IsNullOrEmpty(runnerContext.WorkingDirectory))
Conventions.GetWorkingDirectory = () => runnerContext.WorkingDirectory;
VersionLoader = new VersionLoader(this, _migrationAssembly, Conventions);
MigrationLoader = new MigrationLoader(Conventions, _migrationAssembly, runnerContext.Namespace);
ProfileLoader = new ProfileLoader(runnerContext, this, Conventions);
}
示例13: 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);
}
示例14: MigrationRunner
public MigrationRunner(Assembly assembly, IRunnerContext runnerContext, IMigrationProcessor processor)
{
_migrationAssembly = assembly;
_announcer = runnerContext.Announcer;
Processor = processor;
_stopWatch = runnerContext.StopWatch;
SilentlyFail = false;
CaughtExceptions = null;
Conventions = new MigrationConventions();
ProcessWorkingDirectory(runnerContext);
ProcessAutoReverse(runnerContext);
VersionLoader = new VersionLoader(this, _migrationAssembly, Conventions);
MigrationLoader = new MigrationLoader(Conventions, _migrationAssembly, runnerContext.Namespace);
ProfileLoader = new ProfileLoader(runnerContext, this, Conventions);
}
示例15: MigrationRunner
public MigrationRunner(Assembly assembly, IRunnerContext runnerContext, IMigrationProcessor processor)
{
_migrationAssembly = assembly;
_announcer = runnerContext.Announcer;
Processor = processor;
_stopWatch = runnerContext.StopWatch;
ApplicationContext = runnerContext.ApplicationContext;
TransactionPerSession = runnerContext.TransactionPerSession;
SilentlyFail = false;
CaughtExceptions = null;
Conventions = new MigrationConventions();
if (!string.IsNullOrEmpty(runnerContext.WorkingDirectory))
Conventions.GetWorkingDirectory = () => runnerContext.WorkingDirectory;
_migrationScopeHandler = new MigrationScopeHandler(Processor);
_migrationValidator = new MigrationValidator(_announcer, Conventions);
VersionLoader = new VersionLoader(this, _migrationAssembly, Conventions);
MigrationLoader = new DefaultMigrationInformationLoader(Conventions, _migrationAssembly, runnerContext.Namespace, runnerContext.NestedNamespaces, runnerContext.Tags);
ProfileLoader = new ProfileLoader(runnerContext, this, Conventions);
}