views:

103

answers:

1

Hi! Is it any possible to query the NHibernate cache to find whether my object is there or no?

Thank you!

+2  A: 

First level (session) cache? ISession.Contains(object obj).

Mauricio Scheffer
but how can i do it in Unit Test?..
ifesdjeen
I don't understand
Mauricio Scheffer
inside of unit test, how do i get the access to ISession, should i just create a new session?
ifesdjeen
You can either create a session factory and from there a session, or just mock the ISession with moq or Rhino.Mocks. But that's another question.
Mauricio Scheffer
thank you a lot)
ifesdjeen