Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (TransactionScope scope = new TransactionScope())
- {
- ISession session = sessionFactory.OpenSession();
- MappedEntity entity = new MappedEntity() { Name = "Entity", Value = 20 };
- session.Save(entity);
- entity.Value = 30;
- session.SaveOrUpdate(entity);
- // This returns one entity, when it should return none
- var list = session.
- CreateQuery("from MappedEntity where Value = 20").
- List<MappedEntity>();
- }
- using (TransactionScope scope = new TransactionScope())
- using (ISession session = sessionFactory.OpenSession())
- using (ITransaction transaction = session.BeginTransaction())
- {
- //Do work here
- transaction.Commit();
- scope.Complete();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement