mirror of
https://github.com/DapperLib/Dapper.git
synced 2026-10-23 17:18:46 +08:00
Added NHibernate test. NHibernate now uses stateless session.
This commit is contained in:
@@ -25,9 +25,9 @@ namespace SqlMapper.NHibernate
|
||||
}
|
||||
}
|
||||
|
||||
public static ISession OpenSession()
|
||||
public static IStatelessSession OpenSession()
|
||||
{
|
||||
return SessionFactory.OpenSession();
|
||||
return SessionFactory.OpenStatelessSession();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,6 +177,9 @@ namespace SqlMapper
|
||||
.Query<Post>()
|
||||
.Where(p => p.Id == id).First(), "NHibernate LINQ");
|
||||
|
||||
var nhSession5 = NHibernateHelper.OpenSession();
|
||||
tests.Add(id => nhSession5.Get<Post>(id), "NHibernate Session.Get");
|
||||
|
||||
// bltoolkit
|
||||
var db1 = new DbManager(Program.GetOpenConnection());
|
||||
tests.Add(id => db1.SetCommand("select * from Posts where Id = @id", db1.Parameter("id", id)).ExecuteList<Post>(), "BLToolkit");
|
||||
|
||||
Reference in New Issue
Block a user