Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default Values only when Mapping List to DataReader #3

Closed
jbogard opened this issue Dec 29, 2014 · 3 comments
Closed

Default Values only when Mapping List to DataReader #3

jbogard opened this issue Dec 29, 2014 · 3 comments

Comments

@jbogard
Copy link
Member

jbogard commented Dec 29, 2014

From @dworkman on December 5, 2014 22:8

After upgrading to 3.3, I only get the default values of my object when mapping a DataReader to a List.

For example, when this code is run:

Mapper.CreateMap<IDataRecord, ClientPrice>();

using (SqlDataReader reader = command.ExecuteReader())
{
    prices = Mapper.Map<IList<ClientPrice>>(reader);
}

The prices object correctly contains an object per row in the DataReader, but all of the values are null or their default value. The same code correctly populates the values in 3.2.1.

Copied from original issue: AutoMapper/AutoMapper#643

@jbogard
Copy link
Member Author

jbogard commented Dec 29, 2014

From @akatakritos on December 6, 2014 5:48

Can you try using Mapper.CreateMap<IDataReader, ClientPrice>(); ?

@jbogard
Copy link
Member Author

jbogard commented Dec 29, 2014

From @dworkman on December 8, 2014 16:16

Yes, I tried that to no avail. Only when I went back to 3.2.1 did it start working.

@MrGold
Copy link

MrGold commented Jan 19, 2016

I am facing the same problem with 4.1.1 version. Is there any solution?

@jbogard jbogard closed this as completed Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants