• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IMigrationProcessor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: TransactionalMigrationScope

 public TransactionalMigrationScope(IMigrationProcessor migrationProcessor, Action disposalAction)
     : base(disposalAction)
 {
     if (migrationProcessor == null) throw new ArgumentNullException("migrationProcessor");
     _migrationProcessor = migrationProcessor;
     _migrationProcessor.BeginTransaction();
 }
开发者ID:BarsBarsovich,项目名称:fluentmigrator,代码行数:7,代码来源:IMigrationScope.cs


示例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);
            }
        }
开发者ID:eloekset,项目名称:fluentmigrator,代码行数:28,代码来源:MigrationRunner.cs


示例3: MigrationRunner

 public MigrationRunner(Assembly assembly, IRunnerContext runnerContext, IMigrationProcessor processor)
     : this(new List<MigrationAssemblyInfo>() { new MigrationAssemblyInfo() { Assembly = assembly , Namespace = runnerContext.Namespace} }, 
         runnerContext, 
         processor,
         false)
 {
 }
开发者ID:MikeBagos,项目名称:fluentmigrator,代码行数:7,代码来源:MigrationRunner.cs


示例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);
 }
开发者ID:BarsBarsovich,项目名称:fluentmigrator,代码行数:7,代码来源:ExecuteSqlStatementExpression.cs


示例5: 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


示例6: MigrationContext

 public MigrationContext(IMigrationConventions conventions, IMigrationProcessor migrationProcessor, Assembly migrationAssembly)
 {
     Conventions = conventions;
     Expressions = new List<IMigrationExpression>();
     QuerySchema = migrationProcessor;
     PreviewOnly = migrationProcessor.Options.PreviewOnly;
     MigrationAssembly = migrationAssembly;
 }
开发者ID:mgaspar,项目名称:fluentmigrator,代码行数:8,代码来源:MigrationContext.cs


示例7: MigrationRunner

 public MigrationRunner(IMigrationConventions conventions, IMigrationProcessor processor, IAnnouncer announcer, IStopWatch stopWatch)
 {
     _announcer = announcer;
     SilentlyFail = false;
     CaughtExceptions = null;
     Conventions = conventions;
     Processor = processor;
     _stopWatch = stopWatch;
 }
开发者ID:ngbrown,项目名称:fluentmigrator,代码行数:9,代码来源:MigrationRunner.cs


示例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();
 }
开发者ID:developingchris,项目名称:fluentmigrator,代码行数:10,代码来源:MigrationVersionRunner.cs


示例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);
        }
开发者ID:remids,项目名称:fluentmigrator,代码行数:11,代码来源:ExecuteSqlScriptExpression.cs


示例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);
 }
开发者ID:Andrea,项目名称:fluentmigrator,代码行数:12,代码来源:MigrationVersionRunner.cs


示例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);
        }
开发者ID:remids,项目名称:fluentmigrator,代码行数:16,代码来源:ExecuteEmbeddedSqlScriptExpression.cs


示例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);
        }
开发者ID:briandonahue,项目名称:fluentmigrator,代码行数:18,代码来源:MigrationRunner.cs


示例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);
        }
开发者ID:timscott,项目名称:fluentmigrator,代码行数:20,代码来源:ExecuteEmbeddedSqlScriptExpression.cs


示例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);
        }
开发者ID:giovannifreda,项目名称:fluentmigrator,代码行数:20,代码来源:MigrationRunner.cs


示例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);
        }
开发者ID:BarsBarsovich,项目名称:fluentmigrator,代码行数:22,代码来源:MigrationRunner.cs


示例16: 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


示例17: SetupMigrationRunner

        private static MigrationRunner SetupMigrationRunner(IMigrationProcessor processor)
        {
            Assembly asm = typeof(MigrationRunnerTests).Assembly;
            var runnerContext = new RunnerContext(new TextWriterAnnouncer(System.Console.Out))
            {
                Namespace = "FluentMigrator.Tests.Integration.Migrations"
            };

            return new MigrationRunner(asm, runnerContext, processor);
        }
开发者ID:BarsBarsovich,项目名称:fluentmigrator,代码行数:10,代码来源:MigrationRunnerTests.cs


示例18: ExecuteWith

 public override void ExecuteWith(IMigrationProcessor processor)
 {
     processor.Process(this);
 }
开发者ID:BarsBarsovich,项目名称:fluentmigrator,代码行数:4,代码来源:CreateForeignKeyExpression.cs


示例19: MigrationRunner

 public MigrationRunner(Assembly assembly, IRunnerContext runnerContext, IMigrationProcessor processor)
     : this(new[] { assembly }, runnerContext, processor)
 {
 }
开发者ID:SetekhZ,项目名称:fluentmigrator,代码行数:4,代码来源:MigrationRunner.cs


示例20: GenerateRunner

 internal virtual IMigrationRunner GenerateRunner(IRunnerContext context, IMigrationProcessor processor)
 {
     return new MigrationRunner(_assembly, context, processor);
 }
开发者ID:nucleoid,项目名称:Template-Project,代码行数:4,代码来源:Runner.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IMigrationProcessorOptions类代码示例发布时间:2022-05-24
下一篇:
C# IMigrationGenerator类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap