MySql.Data.MySqlClient.MySqlConfiguration'不包含定义“标准”功能NHibernate [英] MySql.Data.MySqlClient.MySqlConfiguration' does not contain a definition for 'Standard' Fluent NHibernate
问题描述
我想我映射到数据库NHibernate的(从EF推出)。一切似乎都很好,直到这个code
I'm trying to map my database to NHibernate (coming from EF). All seems well until this code
private static ISessionFactory CreateSessionFactory()
{
return Fluently.Configure().Database(
MySqlConfiguration.Standard.ConnectionString(
c => c.FromConnectionStringWithKey("ConnectionString")
)
)
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<MyAutofacModule>())
.BuildSessionFactory();
}
请原谅的格式,这code的目的是要证明的。标准类是不存在的某些原因。我还没有发现任何人有这个问题无论是。任何指针或相关信息,我公司可提供,请让我知道,我会很乐意促成。感谢您的时间。
Please excuse the formatting, The purpose of this code is to demonstrate that The .Standard class is not there for some reason. I haven't found anyone else with this issue either. Any pointers or relevant information I could provide please let me know and I will gladly facilitate. Thank you for your time.
推荐答案
原来,用流利的NHibernate的时候有
Turns out, when using Fluent NHibernate there is a difference between
MySqlConfiguration
和
MySQLConfiguration
容易错过,所以如果你有同样的问题,这是你(和我!)做错了。
Easy to miss, so if you're having this same issue this is what you (and I!) did wrong.
这篇关于MySql.Data.MySqlClient.MySqlConfiguration'不包含定义“标准”功能NHibernate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!