Tôi đang sử dụng fluentnhibernate với PostgreSQL. Fluentnhibernate là phiên bản cuối cùng. Phiên bản PosrgreSQL là 8.4. Mã của tôi cho tạo ISessionFactory:Lưu loát NHibernate và PostgreSQL, SchemaMetadataUpdater.QuoteTableAndColumns - System.NotSupportedException: Phương thức được chỉ định không được hỗ trợ
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();
}
Khi tôi thực thi mã tại SchemaMetadataUpdater.QuoteTableAndColumns dòng (nhibConfig); lỗi ném: System.NotSupportedException: Phương thức đã chỉ định không được hỗ trợ. Làm ơn giúp tôi với! Tôi rất cần giải pháp. Trân trọng
Làm mát điều này ('configuration.ExposeConfiguration ...') cũng hoạt động cho MS SQL (trong trường hợp có một số thắc mắc). – Nux
câu trả lời quá cũ, vẫn còn tươi giải pháp;) Tôi ngưỡng mộ NHibernate nhất quán ... –