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


C# ConventionModelMapper.WithConventions方法代码示例

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


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

示例1: Initialize

        public static Configuration Initialize()
        {
            INHibernateConfigurationCache cache = new NHibernateConfigurationFileCache();

            var mappingAssemblies = new[] {
                typeof(ActionConfirmation<>).Assembly.GetName().Name
            };

            var configuration = cache.LoadConfiguration(CONFIG_CACHE_KEY, null, mappingAssemblies);

            if (configuration == null) {
                configuration = new Configuration();

                configuration
                    .Proxy(p => p.ProxyFactoryFactory<DefaultProxyFactoryFactory>())
                    .DataBaseIntegration(db => {
                        db.ConnectionStringName = "DonSharpLiteConnectionString";
                        db.Dialect<MsSql2008Dialect>();
                    })
                    .AddAssembly(typeof(ActionConfirmation<>).Assembly)
                    .CurrentSessionContext<LazySessionContext>();

                var mapper = new ConventionModelMapper();
                mapper.WithConventions(configuration);

                cache.SaveConfiguration(CONFIG_CACHE_KEY, configuration);
            }

            return configuration;
        }
开发者ID:antgerasim,项目名称:DonSharpArchitecture,代码行数:30,代码来源:NHibernateInitializer.cs

示例2: CreateConfigurationProvider

        public static IConfigurationProvider CreateConfigurationProvider()
        {
            var configFilePath = PathHelpers.InCurrentAppDomain(Constants.NHibernateConfigFileName);
            var configuration = new Configuration();
            configuration.Configure(configFilePath);

            var mapper = new ConventionModelMapper();
            mapper.WithConventions();
            mapper.WithMappings(configuration);

            return new ConfigurationProvider(configuration);
        }
开发者ID:abithyzis,项目名称:Loquacious-NH,代码行数:12,代码来源:NHibernateFacility.cs

示例3: CanGenerateMappingDoc

        public void CanGenerateMappingDoc()
        {
            // Need a separate config so we can get hold of the mapper after using it.
            // If we use the existing config we get a duplicate mapping exception.
            var config = NHibernateInitializer.CreateConfiguration();

            var mapper = new ConventionModelMapper();
            mapper.WithConventions(config);

            var mapping = mapper.CompileMappingFor(typeof(Entity).Assembly.GetExportedTypes());
            var x = mapping.AsString();
            File.WriteAllText("../../NHibernateTests/Output.xml", x);
        }
开发者ID:ctrlpprint,项目名称:Congregation,代码行数:13,代码来源:MappingIntegrationTests.cs

示例4: Initialize

        public static Configuration Initialize() {
            Configuration configuration = new Configuration();

            configuration
                .Proxy(p => p.ProxyFactoryFactory<DefaultProxyFactoryFactory>())
                .DataBaseIntegration(db => {
                    db.ConnectionStringName = "CaTSConnectionString";
                    db.Dialect<MsSql2008Dialect>();
                })
                .AddAssembly(typeof(ActionConfirmation<>).Assembly)
                .CurrentSessionContext<LazySessionContext>();

            ConventionModelMapper mapper = new ConventionModelMapper();
            mapper.WithConventions(configuration);

            return configuration;
        }
开发者ID:transformersprimeabcxyz,项目名称:Sharp-Lite,代码行数:17,代码来源:NHibernateInitializer.cs

示例5: Initialize

        public static Configuration Initialize()
        {
            var configuration = new Configuration();

            configuration
                .Proxy(p => p.ProxyFactoryFactory<DefaultProxyFactoryFactory>())
                .DataBaseIntegration(db =>
                                         {
                                             db.ConnectionStringName = "DevelopmentStack";
                                             db.Dialect<MsSql2008Dialect>();
                                             db.KeywordsAutoImport = Hbm2DDLKeyWords.AutoQuote;
                                         })
                .AddAssembly(typeof (Stack).Assembly)
                .CurrentSessionContext<LazySessionContext>();

            ConventionModelMapper mapper = new ConventionModelMapper();
            mapper.WithConventions(configuration);

            return configuration;
        }
开发者ID:feelexit,项目名称:DevelopmentStack,代码行数:20,代码来源:NHibernateInitializer.cs

示例6: Initialize

        public static Configuration Initialize()
        {
            var cache = new NHibernateConfigurationFileCache();

            var mappingAssemblies = new[] {
                typeof(Entity).Assembly.GetName().Name
            };

            var configuration = cache.LoadConfiguration(CONFIG_CACHE_KEY, null, mappingAssemblies);

            if (configuration == null) {

                configuration = CreateConfiguration();

                var mapper = new ConventionModelMapper();
                mapper.WithConventions(configuration);

                cache.SaveConfiguration(CONFIG_CACHE_KEY, configuration);
            }

            return configuration;
        }
开发者ID:ctrlpprint,项目名称:Congregation,代码行数:22,代码来源:NHibernateInitializer.cs


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