{"action":"created","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/962","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/962/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/962/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/962/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/962","id":113912612,"number":962,"title":"Dynamic Mapping stopped working for IDataReader from 3.3 -> 4","user":{"login":"jkewley","id":1148930,"avatar_url":"https://avatars.githubusercontent.com/u/1148930?v=3","gravatar_id":"","url":"https://api.github.com/users/jkewley","html_url":"https://github.com/jkewley","followers_url":"https://api.github.com/users/jkewley/followers","following_url":"https://api.github.com/users/jkewley/following{/other_user}","gists_url":"https://api.github.com/users/jkewley/gists{/gist_id}","starred_url":"https://api.github.com/users/jkewley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkewley/subscriptions","organizations_url":"https://api.github.com/users/jkewley/orgs","repos_url":"https://api.github.com/users/jkewley/repos","events_url":"https://api.github.com/users/jkewley/events{/privacy}","received_events_url":"https://api.github.com/users/jkewley/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-28T20:15:02Z","updated_at":"2015-10-29T13:33:16Z","closed_at":"2015-10-28T20:16:00Z","body":"I use the following to map the output of some smaller sprocs to DTOs:\r\n```C#\r\nMapper.DynamicMap<IDataReader, List<T>>(aDataReader)\r\n```\r\nThis approach broke when we upgraded to automapper 4.x from 3.3.x. I created a simple console app to demo the problem. Switching between the two versions of the libraries generates different results - mapping works with 3.x and doesn't with 4.x:\r\n\r\n```C#\r\ninternal class Program {\r\n    private static void Main(string[] args) {\r\n        DataSet aDataSet = TestData.Get();\r\n        DataTableReader aDataReader = aDataSet.CreateDataReader();\r\n        List<Person> aReturnValue = Mapper.DynamicMap<IDataReader, List<Person>>(aDataReader);\r\n\r\n        Console.WriteLine(aDataReader.HasRows);\r\n        Console.WriteLine(aReturnValue.Count);\r\n        Console.ReadLine();\r\n    }\r\n}\r\n\r\npublic class Person {\r\n    public string FavColor { get; set; }\r\n    public string First { get; set; }\r\n    public string Last { get; set; }\r\n    public override string ToString() {\r\n        return $\"{First} {Last} \";\r\n    }\r\n}\r\n\r\npublic class TestData {\r\n    public static DataSet Get() {\r\n        DataSet aDataSet = new DataSet();\r\n        DataTable aTable = new DataTable();\r\n        aTable.Columns.Add(\"First\", typeof(string));\r\n        aTable.Columns.Add(\"Last\", typeof(string));\r\n        aTable.Columns.Add(\"Height\", typeof(int));\r\n\r\n        DataRow aNewRow = aTable.NewRow();\r\n        aNewRow[\"First\"] = \"Fred\";\r\n        aNewRow[\"Last\"] = \"Jackson\";\r\n        aNewRow[\"Height\"] = 66;\r\n        aTable.Rows.Add(aNewRow);\r\n\r\n        aNewRow = aTable.NewRow();\r\n        aNewRow[\"First\"] = \"Cindy\";\r\n        aNewRow[\"Last\"] = \"Mansfeld\";\r\n        aNewRow[\"Height\"] = 22;\r\n        aTable.Rows.Add(aNewRow);\r\n\r\n        aDataSet.Tables.Add(aTable);\r\n\r\n        return aDataSet;\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/comments/152179830","html_url":"https://github.com/AutoMapper/AutoMapper/issues/962#issuecomment-152179830","issue_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/962","id":152179830,"user":{"login":"jbogard","id":104498,"avatar_url":"https://avatars.githubusercontent.com/u/104498?v=3","gravatar_id":"","url":"https://api.github.com/users/jbogard","html_url":"https://github.com/jbogard","followers_url":"https://api.github.com/users/jbogard/followers","following_url":"https://api.github.com/users/jbogard/following{/other_user}","gists_url":"https://api.github.com/users/jbogard/gists{/gist_id}","starred_url":"https://api.github.com/users/jbogard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbogard/subscriptions","organizations_url":"https://api.github.com/users/jbogard/orgs","repos_url":"https://api.github.com/users/jbogard/repos","events_url":"https://api.github.com/users/jbogard/events{/privacy}","received_events_url":"https://api.github.com/users/jbogard/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T13:33:16Z","updated_at":"2015-10-29T13:33:16Z","body":"https://github.com/automapper/automapper.data\r\nhttps://www.nuget.org/packages/automapper.data"}}