Let's say that I have classes like this:
public class Parent
{
public int ParentId {get;set;}
public IList<Child> Children {get;set;}
public string Name {get;set;}
}
public class Child
{
public int ChildId {get;set;}
}
Someone calls a method to save a new Parent and passes me a name and a list of Child IDs, and I want to save the Parent. Is there a way that I can save the Parent and associate the Child IDs to it without loading up the Child objects and then adding them to the Children collection? It seems like a waste to load up objects just so that I can get NHibernate to save them when I already have the IDs, which would be all I would need to save the Parent if I did it in a stored procedure.
using... NHibernate 2.0.1GA, SQL Server 2005
Jon