In Entity Framework 4.1 (Code First), each DbSet in a DbContext has a .Local collection of entities that have been added to the context but not yet saved.
In NHibernate 3.1, when I create an entity and save it, it does not commit to the database until the session is flushed. I can either call Session.Flush manually, or rely on automatic flushing when the transaction is committed.
But before the session is flushed, how can I query the session for the unflushed entities? In EF, I could look at DbSet.Local, but I don't see any equivelent in NHibernate. If I've lost reference to the newly created entity but my session is still open and unflushed, is there no way to get the entity back without committing the changes and requerying the database?