c# 4.0 - Get all objects loaded in Current Session -


i want persistent object loaded in current session.

i know persistent context caches associated session, contains dictionary of objects loaded in current session. can 1 tell me way know object loaded in ipersistencecontext cache?

// create our nhibernate session factory

    var sessionfactory = createsessionfactory();     using (var session = sessionfactory.opensession())     {             employee emp;              // populate database             using (var transaction = session.begintransaction())             {                emp = session.query<employee>().where(x => x.name == "bargin basin").firstordefault();                var entries = session.getsessionimplementation().persistencecontext.entityentries;                foreach (var item in entries)                {                     var entityentry = entries[item];                     //i want objects of type like..                     //employee persistedemp = entityentry employee;                                        }           }     } 

i might not have understand question correctly since straightforward if know there persistencecontext, here go:

icollection entities = _session     .getsessionimplementation()     .persistencecontext     .entityentries     .keys; 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -