you don't have to call save or update all you need to do is load the entity 
and change the properties. NH takes care of the rest.
//begin transaction
var root = session.Get<Entity>(id);
root.Foo = something
root.Add=(new Child());
var child = session.Load<Child>(id);
root.Add=(child);
root.Remove(other child);
//commit (or rollback if exception is throw)

Merge is meant for edge cases, 99.99% of the time it's not needed. in fact 
in most cases all you need to do is save transient objects, after that NH 
takes care of the rest. and ORM isn't a cure all for sql queries. it 
addresses the disparity between an object model and  relational data.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/7a-ZmOuyiqcJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to