相关疑难解决方法(0)

流畅的NHibernate列映射与保留字

我已经读过,使用后退勾号应该允许使用保留字.我正在使用SQL Server和Fluent NHibernate,并且列名为"File".如果我用它来映射

"`File" 
Run Code Online (Sandbox Code Playgroud)

它尝试使用

[Fil]
Run Code Online (Sandbox Code Playgroud)

所以它正确添加括号,但从末尾删除"e".如果我将其映射为

"`Filee"
Run Code Online (Sandbox Code Playgroud)

它用

[File]
Run Code Online (Sandbox Code Playgroud)

正确.

我做错了什么或者这是NHibernate或Fluent Nhibernate中的错误?

nhibernate fluent-nhibernate

15
推荐指数
3
解决办法
4362
查看次数

Fluent NHibernate和PostgreSQL,SchemaMetadataUpdater.QuoteTableAndColumns - System.NotSupportedException:不支持指定的方法

我在PostgreSQL上使用fluentnhibernate.Fluentnhibernate是最新版本.PosrgreSQL版本是8.4.我的创建ISessionFactory的代码:

public static ISessionFactory CreateSessionFactory()
{
        string connectionString = ConfigurationManager.ConnectionStrings["PostgreConnectionString"].ConnectionString;
        IPersistenceConfigurer config = PostgreSQLConfiguration.PostgreSQL82.ConnectionString(connectionString);

        FluentConfiguration configuration = Fluently
            .Configure()
            .Database(config)
            .Mappings(m =>
                m.FluentMappings.Add(typeof(ResourceMap))                                    
                                .Add(typeof(TaskMap))
                                .Add(typeof(PluginMap)));
        var nhibConfig = configuration.BuildConfiguration();
        SchemaMetadataUpdater.QuoteTableAndColumns(nhibConfig);
        return configuration.BuildSessionFactory();
}
Run Code Online (Sandbox Code Playgroud)

当我在SchemaMetadataUpdater.QuoteTableAndColumns(nhibConfig)行执行代码时; throw error:System.NotSupportedException:不支持指定的方法.请帮帮我!我非常需要解决方案.最好的祝福

postgresql nhibernate fluent-nhibernate

10
推荐指数
1
解决办法
5556
查看次数

标签 统计

fluent-nhibernate ×2

nhibernate ×2

postgresql ×1