0
我想創建一個連接到MySQL使用NHibernate和FluentNHibernate。我加MySql.Data
與nuget
但當我嘗試創建連接它拋出一個異常與消息The name MySQLConfiguration not exist in the current context
嘗試創建一個NHibernate和FluentNHibernate連接MySQL?
我怎麼能解決這個問題?
試圖
private static ISessionFactory getConnection(){
return Fluently.Configure().
Database(MySQLConfiguration.Standard.ConnectionString(
x=>x.Server("localhost").
Username("root").
Password("").
Database("usuarios_db")
)).
Mappings(m => m.FluentMappings.AddFromAssemblyOf<UsuarioMap>()).
ExposeConfiguration(cfg => new SchemaUpdate(cfg).Execute(false, true)).
BuildSessionFactory();
}