AutoMapper Mapping IEnumerable to DataReader Issue

Posted by user74825 on Stack Overflow See other posts from Stack Overflow or by user74825
Published on 2010-03-11T22:26:59Z Indexed on 2010/04/21 15:33 UTC
Read the original article Hit count: 1013

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about automapper

Related posts about .NET