I apologize if this is a duplicate but I did not find anything that seemed to be matching up with what I am looking for.
As we all know in Automapper we can perform convention based mappings...
My Question
Is it possible to access extension methods (LINQ.First()) on objects in a collection, to go "n" levels deep? See example below
My Entities
public class Store
{
public IList< Departments > Departments {get;set;}
}
public class Departments
{
public bool Open {get;set;}
}
What I want to be able to do
Mapper.Map< Store, StoreEditModel >();
public class StoreEditModel
{
public bool DepartmentsFirstOpen {get;set;}
}
Applicable Use (So you don't think I'm stupid)
The applicable use is to assume that all items in the collection should be in the same (Open)state.
So when my edit model comes back to be processed, I can open or close all Departments in the Store respectively.
Outside Resources I already read the following on AutoMapper's site.... http://automapper.codeplex.com/wikipage?title=Flattening