更新
我想知道一个实例是否已从 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.
}
}