when you associate a parent to a child the association goes both ways. I 
like to encapsulate my collections, so the only way to add to add a child is 
by the parent. it looks like this

class Parent
{
   private ICollectio<Child> children = new List<Child>();

   public IEnumerable<Child> {get{return children;}}

   public void AddChild(string name)
   {
      children.Add(new Child(this){Name= name});
   }
}

this allows my code to look like this
session.Get<Parent>(id).AddChild("jason");
NH will automatically save the changes when the session is flushed. and I 
have 1 location in which to manage adding children to the parent.

> I was going to offer $10 to whomever decided to actually help.
LOL. you don't get OSS do you :) not to mention the talent/value of the 
people assisting you.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
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