When using the mapping-by-code/conformist approach in NHibernate, how can I create a class mapping so that Person.CountryId is created as a Foreign Key to my Country entity?
When loading the Person entity, I do not want to use the Country entity directly in the person entity (since they are different aggregate roots) but only reference it by ID and still have the FK relation defined in the database.
public class Person : Entity, IEntity
{
public Guid CountryId { get; protected set; }
}
public class Country : Entity, IEntity
{
public string Name { get; protected set; }
}