Hi all,
suppose I have the following
Code:
class Customer {
public int Id { get; set; }
}
class Order {
public int Id { get; set; }
public int Customer { get; set; }
}
Now, given I know only of Customer's id value (e.g. CustomerId = 343) I'd like to instantiate an Order and have its Customer set to customer with that id. The important part here is I do not wish to do this explicitly (by loading Customer with session.Load<Customer>(id) and set the Customer property) instead, I'd like to provide Order with the value of CustomerId and have Nhibernate figure out CustomerId-Customer relationship and set Customer property for me.
Is it possible to do this?