我想找出是否一個實例已經從NHibernate的第一緩存
private static void Evict()
{
using (var session = sessionFactory.OpenSession())
using (var transaction = session.BeginTransaction())
{
var customers = session.Query<Customer>().ToList();
var customer = customers[0];
session.Delete(customer);
transaction.Commit();
//how to find out whether or not customers[0] is still in session.
}
}
這應該用於什麼? –
僅用於測試 – Pingpong
你真的想測試什麼? –