Hi Matt,

I know this post is very old, but we're having the same problems and I was 
hoping you might have figured out a way to do it...
If that is the case, would you mind sharing? 


Thanks a lot! 
Wouter


Op dinsdag 20 augustus 2013 16:48:25 UTC+2 schreef matt fowler:
>
> I have question with using a many-to-one relationship with an 
> ICompositeUserType.
>
> In the documentation for ICompositeUserType, it states that it can support 
> many-to-one relationships.
>
> I am having some trouble finding examples of this.  Here is my scenario
>
> I have an Individual domain object:
>
> Individual
> {
> public virtual string Id {get;set;}
> public virtual Address HomeAddress{get;set;}
> public virtual Address WorkAddress{get;set;}
> }
>
> and i have an Address domain object
>
> Address
> {
> //no id on the address domain object
> public virtual string StreetAddress{get;set;}
> public virtual string City{get;set;}
> public virtual string State{get;set;}
> ....
> }
>
> My database schema is an Individual table, and an Address table.  There is 
> a one-to-many individual to address relationship.  The address table has a 
> composite key of individualID and type, but we do not want to expose these 
> on the Address domain object.  This is a legacy database that we cannot 
> modify.
>
> We would like to maintain the Individual domain object with HomeAddress 
> and WorkAddress as seperate properties, instead of a Collection<Address> 
> Addresses.
>
> We were hoping to be able to use ICompositeUserType, but we are struggling 
> with a way to implement it.  We can't map the address table to the 
> individual domain object.
>
> thank you!
>
>
> matt
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to