我正在尝试使用NHibernate和FluentNHibernate创建与MySQL的连接。我在MySql.Data
添加了nuget
但是当我尝试创建连接时,它会抛出一条带有消息The name MySQLConfiguration not exist in the current context
我怎么解决这个问题?
尝试
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();
}
答案 0 :(得分:0)
解决。问题出在我的Visual Studio 2012上,它没有导入库,我也不知道需要哪些库,而且发生了问题。
现在可行。
appointment: {
reason: 'Johnny to Busby3',
location: [{
name: 'Buga Buga Hospital',
phoneNumber: '(719) 589-1011',
address: {
street: '125 High Street',
region: 'Buga Buga, HI 85555',
},
distance: '100m',
coords: {
lat: 51.455041,
lng: -0.9690884
},
openingTimes: [{
days: 'Monday - Friday',
opening: '7:00 am',
closing: '7:00 pm',
closed: false
}, {
days: 'Saturday',
opening: '8:00 am',
closing: '5:00 pm',
closed: false
}, {
days: 'Sunday',
closed: true
}],
}],