OK, I spent 12 hours due to a trivial problem.
The interceptor did not work for ISession.Get
that's what i was wrong
public UserModel Save(UserModel user)
{
UserModel result = null;
using (ITransaction transaction = session.BeginTransaction())
{
var id = session.Save(user);
result = session.Get<UserModel>(id);
transaction.Commit();
}
return result;
}
I realized that my interceptor was working fine after I decided to just leave it and start writing unit test for a GetUsersmethod that uses the criteria API.
FYI, if you are interested in NHibernate interceptor, I found it here .
source
share