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


C# SchemaExport.SetDelimiter方法代码示例

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


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

示例1: CreateSchema

 static void CreateSchema()
 {
     SchemaExport export = new SchemaExport(m_NHConfiguration);
     export.SetDelimiter(";");
     export.SetOutputFile(@"db.sql").Execute(false, false, false);
     Console.WriteLine("Schema Exported");
 }
开发者ID:JoeBuntu,项目名称:Inventory,代码行数:7,代码来源:Program.cs

示例2: CreateSchemaExport

 private SchemaExport CreateSchemaExport(Configuration config)
 {
     var result = new SchemaExport(config);
     if (!string.IsNullOrEmpty(this.delimiter)) result.SetDelimiter(this.delimiter);
     if (!string.IsNullOrEmpty(this.outputFile)) result.SetOutputFile(this.outputFile);
     return result;
 }
开发者ID:night-king,项目名称:NHibernate-Shards,代码行数:7,代码来源:ShardedSchemaExport.cs

示例3: Index

 // GET: /Admin/
 public ActionResult Index()
 {
     var se = new SchemaExport((new Configuration()).Configure());
     se.SetDelimiter(";\n");
     TextWriter oldOut = Console.Out;
     var creationSchema = new StringWriter();
     Console.SetOut(creationSchema);
     se.Create(true, false);
     Console.SetOut(oldOut);
     ViewBag.SchemaExport = creationSchema.ToString();
     return View();
 }
开发者ID:GustavoRusso,项目名称:standings,代码行数:13,代码来源:AdminController.cs

示例4: CriarSchema

        public void CriarSchema()
        {
            Configuration configuration = SessionFactory.Configuration();

            var schemaExport = new SchemaExport(configuration);
            using (TextWriter stringWriter = new StreamWriter("C:\\exemploNH.sql"))
            {
                schemaExport.SetDelimiter(";");
                schemaExport.Execute(true, false, false, null, stringWriter);
            }

            // Depois de criar as tabelas no MySQL, altere o Storage Engine delas para
            // InnoDB, assim vc tem suporte a transações (MyISAM, q é o padrão, não suporta).
            // Vc pode fazer isso por comandos sql: 'ALTER TABLE motoristas ENGINE=InnoDB;'
        }
开发者ID:diegoponciano,项目名称:Exemplos-NHibernate,代码行数:15,代码来源:CriacaoBancoDeDados.cs

示例5: ExportSchema

        /// <summary>
        /// 
        /// </summary>
        /// <param name="cfg"></param>
        /// <param name="outputFileName"></param>
        /// <param name="script"></param>
        /// <param name="export"></param>
        /// <param name="justDrop"></param>
        public static void ExportSchema(Configuration cfg, string outputFileName, bool script, bool export, bool justDrop)
        {
            SchemaExport exporter = new SchemaExport(cfg);
            //exporter.SetOutputFile(outputFileName);
            exporter.SetDelimiter(";");

            using (System.IO.StreamWriter sw = new System.IO.StreamWriter(outputFileName, false, Encoding.UTF8))
            {
                Console.SetOut(sw);
                exporter.Execute(script, export, justDrop);
            }

            //exporter.Drop(true, false);  ==  == exporter.Execute(true, false, true, true)
            //exporter.Create(true, false); == exporter.Execute(true, false, false, true)
        }
开发者ID:urmilaNominate,项目名称:mERP-framework,代码行数:23,代码来源:NHibernateHelper.cs

示例6: AddNHibernate

        public static void AddNHibernate(this IServiceCollection serviceCollection,
            string type, string connectionString) {
            var configuration = Fluently.Configure()
                .Database(GetDatabaseConfiguration(type, connectionString))
                .Mappings(m => m.FluentMappings.AddFromAssemblyOf<AccountMap>());
#if DEBUG
            configuration = configuration.ExposeConfiguration(config => {
                var schemaExport = new SchemaExport(config);
                schemaExport.SetDelimiter(";");
                schemaExport.SetOutputFile("schema.sql").Execute(true, false, false);
            });
#endif

            var factory = configuration.BuildSessionFactory();

            serviceCollection.AddSingleton(factory);
            serviceCollection.AddScoped<IScopeFactory, ScopeFactory>();
        }
开发者ID:LeadisJourney,项目名称:Api,代码行数:18,代码来源:ServiceCollectionExtensions.cs

示例7: ExecuteTask

        /// <summary>
        /// Executes the task.
        /// </summary>
        protected override void ExecuteTask()
        {
            Configuration config = new Configuration();
            Dictionary<string, string> properties = new Dictionary<string, string>();

            properties[NHibernate.Cfg.Environment.ConnectionProvider] = ConnectionProvider;
            properties[NHibernate.Cfg.Environment.Dialect] = Dialect;
            properties[NHibernate.Cfg.Environment.ConnectionDriver] = ConnectionDriverClass;
            properties[NHibernate.Cfg.Environment.ConnectionString] = ConnectionString;

            config.AddProperties(properties);

            foreach (string filename in Assemblies.FileNames)
            {
                Log(Level.Info, "Adding assembly file {0}", filename);
                try
                {
                    Assembly asm = Assembly.LoadFile(filename);
                    config.AddAssembly(asm);
                }
                catch (Exception e)
                {
                    Log(Level.Error, "Error loading assembly {0}: {1}", filename, e);
                }
            }

            SchemaExport se = new SchemaExport(config);
            if (!IsStringNullOrEmpty(OutputFilename))
            {
                se.SetOutputFile(OutputFilename);
            }
            se.SetDelimiter(Delimiter);
            Log(Level.Debug, "Exporting ddl schema.");
            se.Execute(OutputToConsole, ExportOnly, DropOnly, FormatNice);

            if (!IsStringNullOrEmpty(OutputFilename))
            {
                Log(Level.Info, "Successful DDL schema output: {0}", OutputFilename);
            }
        }
开发者ID:spib,项目名称:nhcontrib,代码行数:43,代码来源:Hbm2DdlTask.cs

示例8: CreateSchemaExport

		private static SchemaExport CreateSchemaExport(Configuration cfg)
		{
			SchemaExport export = new SchemaExport(cfg);

			// set the delimiter, but only if it is not the default delimiter
			if (schemaDelimiter != defaultSchemaDelimiter)
			{
				export.SetDelimiter(schemaDelimiter);
			}

			return export;
		}
开发者ID:joshrobb,项目名称:Castle.ActiveRecord,代码行数:12,代码来源:ActiveRecordStarter.cs


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