{"action":"opened","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2634","repository_url":"https://api.github.com/repos/AutoMapper/AutoMapper","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2634/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2634/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/2634/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/2634","id":323333895,"number":2634,"title":"Mapping nested types with inheritance to a flattened DTO raises exception","user":{"login":"gdbjohnson","id":387883,"avatar_url":"https://avatars3.githubusercontent.com/u/387883?v=4","gravatar_id":"","url":"https://api.github.com/users/gdbjohnson","html_url":"https://github.com/gdbjohnson","followers_url":"https://api.github.com/users/gdbjohnson/followers","following_url":"https://api.github.com/users/gdbjohnson/following{/other_user}","gists_url":"https://api.github.com/users/gdbjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/gdbjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdbjohnson/subscriptions","organizations_url":"https://api.github.com/users/gdbjohnson/orgs","repos_url":"https://api.github.com/users/gdbjohnson/repos","events_url":"https://api.github.com/users/gdbjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/gdbjohnson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-15T18:33:19Z","updated_at":"2018-05-15T18:33:19Z","closed_at":null,"author_association":"NONE","body":"\r\n### Source/destination types\r\n\r\n```csharp\r\npublic class Schedule\r\n{\r\n  public ScheduleData ScheduleData { get; set; }\r\n}\r\n\r\n// Base type\r\npublic abstract class ScheduleData {}\r\n\r\n// Sub Types\r\npublic class ActionItemScheduleData : ScheduleData {}\r\npublic class FormScheduleData : ScheduleData {}\r\n```\r\n\r\n### Mapping configuration\r\n\r\n```csharp\r\npublic class ScheduleMapper : Profile\r\n{\r\n    protected override void Configure()\r\n    {\r\n        CreateMap<ActionItemScheduleData, ScheduleDto>(MemberList.Destination)\r\n            .ForMember(x => x.Name, c => c.MapFrom(m => m.ActionDescription));\r\n\r\n        CreateMap<MobileFormScheduleData, ScheduleDto>(MemberList.Destination)\r\n            .ForMember(x => x.Name, c => c.MapFrom(m => m.Description));\r\n\r\n        CreateMap<Schedule, ScheduleDto>(MemberList.Destination)\r\n            .AfterMap((s, d) => \r\n            {\r\n                if (s.ScheduleData is MobileFormScheduleData)\r\n                {\r\n                    Mapper.Map((MobileFormScheduleData) s.ScheduleData, d);\r\n                }\r\n                else\r\n                {\r\n                    Mapper.Map((ActionItemScheduleData) s.ScheduleData, d);\r\n                }\r\n           });\r\n\r\n    }\r\n}\r\n```\r\n\r\n### Version: x.y.z\r\n Using Automapper 4.2.1\r\n\r\n### Expected behavior\r\n\r\nMapping success!\r\n\r\n### Actual behavior\r\n\r\nException: Missing type map configuration or unsupported mapping.\r\n\r\n### Steps to reproduce\r\n\r\n```csharp\r\nvar scheduleDto = mapper.Map<ScheduleDto>(schedule);\r\n```\r\n"}}
{"actor":{"display_login":"gdbjohnson"}}