tags:

views:

61

answers:

1

I have an object like this:

public class Foo {
    public string Title { get; set; }
    public IList<FooChild> Children { get; set; }
}

public class FooChild {
    public string Title { get; set; }
}

I want to map this onto a view model like this:

public class FooDTO {
    public string Title { get; set; }
    public List<string> ChildrenTitles { get; set; }
}

I know I could do this by creating a FooChildDTO and creating a map for it, but I really just want to coalesce the children titles into a simple list of strings.

A: 

No, not automatically right now. You can do a resolver or type converter for FooChild -> string, but nothing that looks at the name of the property and auto-rolls it up. This is one of the big enhancements I'm looking at for 2.0, however.

Jimmy Bogard