AutoMapper Mapping IEnumerable to DataReader Issue
- by user74825
I am using AutoMapper to datareader using code as discussed below
http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/
I see it being very flakky...and unpredictable.
1) Same code with same datareader at times brings value back to the dto result set and at times doesnot.
2) I have an ID value coming from database as 100, 200. When it maps to the DTO that is of type integer this 100 is changed to a large value (like 234343211).
Any ideas on why am I seeing this inconsitency. Should I be using the standard
while (reader.Read())? and stop using automapper?