I'm inserting a parent object in the database using Fluent NHibernate, This object have a child, and this child is already persisted in database, but I only have the id from this child.
How can I insert the parent object with his foreign key (child) only setting the id to a child object?
Example:
ObjectParent parent = new ObjectParent();
ObjectChild child = new ObjectChild();
child.Id = 5; // 5 is the id from the child in the database
parent.Child = child;
Service.Create(parent); // here I need to insert the parent with the referenced foreign key (id = 5)
EDIT:
I can't get the child object from the database.