I have a simple model I\'m attempting to persist using fluent-nhibernate:
public class Person
{
public int Id { get; set; }
public string Name { get; set
Seems to be a design issue
If the intent is to avoid reference of person within address on a/c of contextual use of the address
Then i would introduce a "discriminator"
i.e.
Address {AddressId, ...}
PersonAddress : Address {Person, ...},
CustomerAddress : Address {Customer, ...},
VendorAddress : Address {Vendor, ...}
You could infer the discriminator via formula as well rather specifying a hard discriminator value
Ref : Discriminator based on joined property
Alternatively modify the db structure if allowed / possible
Persons [PersonId, ...]
Addresses [AddressId]
AddressDetails [AddressDetailId, AddressId, ...]
With Mappings as follows (no idea how this would be done in fluent, but is possible via xml) 1.) Person + Addresses via a join table 2.) Address + AddressDetails via reference
I would definitely prefer the first option
cheers ...