We have a complex object User that contains a bunch of lists of other objects.
User
List<User> Subordinates {get; set;}
etc....
When we run the code, it's quite acceptable for some of the properties to be in error because the connection to the database has been closed and we didn't get the say Subordinates.
In AutoMapper I am getting an error when trying to map the User class to another Class.
So the error in the Subordinates property is;
'((System.Data.Entity.DynamicProxies.User_26F7582000F06E0D5B307573194E69014E40D1C586E95D4E4932757C1F4DE360)((System.Data.Entity.DynamicProxies.WorkflowTask_DEDE69BC0D3CAFD0CCDA62406BC48A7A7CCBD5E8B13369FF5E761B64348A767C)thisTask).User).Subordinates' threw an exception of type 'System.ObjectDisposedException'
And the error that AutoMapper is throwing is;
{"Error mapping types.\r\n\r\nMapping types:\r\nWorkflowTask -> jsonTask\r\nDataRepository.WorkflowTask -> Tasks.Models.jsonTask\r\n\r\nType Map configuration:\r\nWorkflowTask -> jsonTask\r\nDataRepository.WorkflowTask -> Tasks.Models.jsonTask\r\n\r\nProperty:\r\nUser"}
And then in the InnerException;
{"Error mapping types.\r\n\r\nMapping types:\r\nUser -> jsonUser\r\nDataRepository.User -> Tasks.Models.jsonUser\r\n\r\nType Map configuration:\r\nUser -> jsonUser\r\nDataRepository.User -> Tasks.Models.jsonUser\r\n\r\nProperty:\r\nSubordinates"}
I just need AutoMapper to ignore those properties that are in error.