You may also want to look into IUserCollectionType.  There's not much
info around on it, but Billy McCafferty did a 4 part series on custom
collections where he implemented this.

Another option (and better IMHO) is to handle the translation within
your code, e.g. in a service class that translates the
ICollection<Order> into an IDictionary<Guid, OrderDto>.

Cheers,
John

On Aug 11, 1:04 pm, Krzysztof Koźmic (2) <[email protected]> wrote:
> Alternatively, I can say in mapping that I map to Order, but I'd want
> to intercept the call to setter of the Orders property on my
> ClientData, to convert Orders to OrderDTOs. Is that possible?
>
> On Aug 11, 1:46 pm, Krzysztof Koźmic (2) <[email protected]> wrote:
>
>
>
> > Can I use IUserType for that? This feels like a place for things like
> > that.
> > How would I implement that in this situation?
>
> > On Aug 11, 1:11 pm, Tuna Toksoz <[email protected]> wrote:
>
> > > mademe worried :) trying to find such thing :D
>
> > > Tuna Toksöz
> > > Eternal sunshine of the open source mind.
>
> > >http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitt...
>
> > > 2009/8/11 Krzysztof Koźmic (2) <[email protected]>
>
> > > > lol, no, there's no 'Alias' nor 'HqlQuery' AFAIR
>
> > > > On Aug 11, 12:49 pm, Tuna Toksoz <[email protected]> wrote:
> > > > > Did it work?
>
> > > > > Tuna Toksöz
> > > > > Eternal sunshine of the open source mind.
>
> > > >http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitt...
>
> > > > > 2009/8/11 Krzysztof Koźmic (2) <[email protected]>
>
> > > > > > Yeah, you did.
>
> > > > > > What I'm after is something like:
>
> > > > > > <map name="CommentorsOnMyPosts" table="UserCommentorsOnPosts">
> > > > > >    <key column="UserId"/>
> > > > > >    <index-many-to-many column="CommentorUserId" class="User"/>
> > > > > >     <many-to-many class="Post" column="PostId" Alias="p" 
> > > > > > HqlQuery="new
> > > > > > PostDto(p.Foo, p.Bar)" access="read-only"/>
> > > > > > </map>
>
> > > > > > On Aug 11, 12:45 pm, Tuna Toksoz <[email protected]> wrote:
> > > > > > > ER I missed the dto part.
>
> > > > > > > Tuna Toksöz
> > > > > > > Eternal sunshine of the open source mind.
>
> > > > > >http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitt.
> > > > ..
>
> > > > > > > 2009/8/11 Krzysztof Koźmic (2) <[email protected]>
>
> > > > > > > > Yeah, but that's mapping Entity to Entity. I want to map Entity 
> > > > > > > > to
> > > > DTO
> > > > > > > > instantiated on the fly from Entity.
>
> > > > > > > > On Aug 11, 12:37 pm, Tuna Toksoz <[email protected]> wrote:
> > > > > > > > > <map name="CommentorsOnMyPosts" table="UserCommentorsOnPosts">
> > > > > > > > >     <key column="UserId"/>
> > > > > > > > >     <index-many-to-many column="CommentorUserId" 
> > > > > > > > > class="User"/>
> > > > > > > > >     <many-to-many class="Post" column="PostId"/></map>
>
> > > > > >http://ayende.com/Blog/archive/2009/06/03/nhibernate-mapping-ndash-lt.
> > > > ..
>
> > > > > > > > > Tuna Toksöz
> > > > > > > > > Eternal sunshine of the open source mind.
>
> > > >http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitt.
> > > > > > ..
>
> > > > > > > > > 2009/8/11 Krzysztof Koźmic (2) <[email protected]>- Hide 
> > > > > > > > > quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to