Hi Here you've an example: http://unhaddins.googlecode.com/svn/trunk/Examples/uNHAddins.Examples.Course/YourPrjDomain/Transformers/ http://unhaddins.googlecode.com/svn/trunk/Examples/uNHAddins.Examples.Course/EntitiesNHPersistence.Tests/Transformers/TransformersFixture.cs
Cheers On Wed, Mar 18, 2009 at 5:22 PM, Jan Van Ryswyck <jan.van.rysw...@gmail.com>wrote: > > I have a question about using projections on collections. Suppose I > have the following domain classes: > > public class Catalog > { > public IEnumerable<Category> Categories { get; set; } > public String Name { get; set; } > } > > public class Category > { > public String Name { get; set; } > } > > that I want to project to the following DTO's: > > public class CatalogDTO > { > public IEnumerable<CategoryDTO> Categories { get; set; } > public String Name { get; set; } > } > > public class CategoryDTO > { > public String Name { get; set; } > } > > The name property of the Catalog is quite easy, but I don't know how > to do the Categories: > > DetachedCriteria.For<Catalog>() > .CreateAlias("Categories", "categories") > .SetProjection(Projections.ProjectionList() > .Add(Projections.Property("Name"), > "Name")) > .SetResultTransformer(Transformers.AliasToBean(typeof > (CatalogDTO))); > > Should I create a ProjectionList inside the current ProjectionList for > the Categories? Any thoughts? Thanks in advance. > > > > > -- Dario Quintana http://darioquintana.com.ar --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to nhusers@googlegroups.com To unsubscribe from this group, send email to nhusers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---