How do you handle look up values with NHibernate? For example, I have an Order entity and it has a BillingAddress property that is a value object named Address, it's simple if the Address object just contains State and Country properties as strings. But what if I want a Country contains a list of its states the Order form can populate appropriate state dropdown list for each selected country.
Can I still create Country and State as value objects? Or they must be entities? And if they are entities, can Address be a value object?
Below is a sample code of my example:
public class Order { public virtual int OrderId { get; set; } public virtual Address BillingAddress { get; set; } } public class Address { public virtual State State { get; set; } public virtual Country Country { get; set; } } public class Country { public virtual string Name { get; set; } public virtual ICollection<State> States { get; set; } } public class State { public virtual string Name { get; set; } public virtual Country Country { get; set; } }