Using NHibernate I need to insert an entity into a database that has a child entity. Example:
public class Reservation
{
public int Id { get; set; }
public Service Service { get; set; }
}
public class Service
{
public int Id { get; set; }
}
I need to create a new Reservation and insert it. However, when constructing the Reservation for insertion, I don't have the Service entity, but I do have the Service's Id value. Is there a way to insert my reservation without fetching the Service first?