I have a Conference that has a list of a related Conference. I want the top level conference to give a list of its related conferences but for it to stop there.
I tried the following but when setting maxDepth to 1 I get null for the first child. When setting maxDepth to 2 I get a stockoverflow. If any one knows how to fix this help is appreciated. Thanks, Alex
Mapper.CreateMap<Data.Conference, Dto.Conference>().MaxDepth(2);
First time using automapper, let me try to explain what I'm trying to solve with MaxDepth:
Conference has a list of associated Conference. So Conference A has an associated Conference B. And Conference B has an associated Conference A.
Now I am sending a list of Conferences with WCF. Clearly sending Conference A over the wire will result in a stack overflow. Is it possible to prevent this with automapper while keeping the first level of associated conferences