Assume I have two classes related by one-two-many:
public class Customer
{
public virtual Guid Id {get; set;}
public virtual string Name {get; set;}
public virtual IList<Order> Orders {get; set;}
}
public class Orders
{
public virtual Guid Id {get; set;}
public virtual string Name {get; set;}
// public virtual Customer Customer {get; set;}`
}
And I don't want the documented Customer object in Orders class to be exist - but it means I can't use the References method to do the mapping References(x => x.Customer).
I used only the HasMany(x => x.Orders) method when mapping Customer object. When I created the tables and inserted data, the Foreign key column that was created by nhibernate (Customer_id )in the orders table is NULL.
Is it possible to do it without adding the Customer property to Orders object?