I have following entities Country, State, City
I have also User entity.
Country, State and the City does not have relationship with user entity. User does not have direct relationship with Country, State or City.
I want to be able to update user address details in a way that user will select country, state and city and save this values. I'm thinking to introduce Address value object which will store this user address information.
Is this good idea? How would you handle this scenario?
I'm using nhibernate orm and mapping using Conformist (mapping by code approach) So I was thinking to map Address as value object
Component(c => c.Address, AddressMap.Mapping()); public class AddressMap { public static Action<IComponentMapper<Address>> Mapping() { return c => { c.Property(p => p.Country); c.Property(p => p.State); c.Property(p => p.City); }; } } having this in UserMap
Component(c => c.Address, AddressMap.Mapping()); I'm getting following error
The type initializer for 'NHibernate.SessionProvider' threw an exception. {"Could not determine type for: Model.Country, ..., for columns: NHibernate.Mapping.Column(Country)"}
Without this line Component(c => c.Address, AddressMap.Mapping()); in UserMap I do not have any error (also I do not have Address value object mapped :).