Привет всем. Я новичок в nhibernate, не могли бы вы помочь мне проверить, что здесь не так?я использую hbibernate + webapp mvc visual studio 2017:
private void BuildConfiguration()
{
//error here
Configuration.Configure(@"~\Models\hibernate.cfg.xml");
//already tried next command with same error
//Configuration.Configure(@"~\Models\hibernate.cfg.xml");
Configuration.AddAssembly(GetType().Assembly);
Configuration.AddFile(@"~\Mappings\Users.hbm.xml");
}
hibernate.cfg.xml
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">
NHibernate.Connection.DriverConnectionProvider
</property>
<property name="connection.driver_class">
NHibernate.Driver.SqlClientDriver
</property>
<property name="connection.connection_string">
Server=(localdb)\SQLEXPRESS;database=dbtest;Integrated User ID=sa;Password=sa123;
</property>
<property name="dialect">
NHibernate.Dialect.MsSql2012Dialect
</property>