NHibernate insert childs objects -


i need insert object child, child not persisted in database, how insert parent object , child in same save() method?

example:

public class parent {    public virtual int id;    public virtual child child; }  public class child {    public virtual int id; }  public class test {    public void insertparent()    {      parent p = new parent();      child c = new chield();      p.child = c;      //here need insert parent , child because nobody persisted in database      service.save(p);    } } 


Comments

Popular posts from this blog

android - Inheriting from Theme.AppCompat* -

broadcastreceiver - android BOOT_COMPLETED not received if not activity intent-filter -

basic authentication with http post params android -