IIRC, you can't project on lists.

Tuna Toksöz
Eternal sunshine of the open source mind.

http://devlicio.us/blogs/tuna_toksoz
http://tunatoksoz.com
http://twitter.com/tehlike




On Sat, May 16, 2009 at 9:36 PM, mantzas <[email protected]> wrote:

>
> HI,
>
> given a Class lets say
>
> public class User
> {
>        public virtual int Id {get;set;}
>        public virtual IList<ProjectGroup> ProjectGroups{get;set;}
> }
>
> and a DTO
>
> public class UserDTO
> {
>        public int Id {get;set;}
>        publicIList<ProjectGroupDTO> ProjectGroups{get;set;}
> }
>
> i want to project the results from the User to UserDTO.
>
> DetachedCriteria dc = DetachedCriteria.For(typeof (User));
> dc.CreateAlias("ProjectGroups", "pg");
> dc.SetProjection(Projections.ProjectionList()
>                             .Add(Projections.Property("Id"),"Id")
>                             .Add(Projections.Property
> ("User.UserGroups"), ));
>
> dc.SetResultTransformer(Transformers.AliasToBean(typeof (UserDTO)));
>
> something is missing or simply i dont get it!!!
>
> Can someone please guide me???
>
> Thx
>
>
>
>
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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