Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Different mapping behavior for Nullable properties after updating from 2.1.267 to 2.2.0 #257

Closed
rjbaucells opened this Issue · 1 comment

2 participants

Rogelio J. Baucells Jimmy Bogard
Rogelio J. Baucells

I am seeing a different mapping behavior after updating AutoMapper from 2.1.267 to 2.2.0 for Nullable properties.

Using the old version (2.1.267) the property value A is set to null in the following example:

class Source { public int? A { get; set; } }
class Target { public int? A { get; set; } }

Mapper.CreateMap();

var d = Mapper.Map(new Source { A = null }, new Target { A = 10 });

After updating AutoMapper (2.2.0) the property value is not set to null as a result of the mapping action (value continues to be 10).

Jimmy Bogard jbogard referenced this issue from a commit in jbogard/AutoMapper
Jimmy Bogard jbogard Reproducing issue #257
Updating the project

Using nullable types in type check, closes #257
755fe92
Jimmy Bogard jbogard closed this issue from a commit
Jimmy Bogard jbogard Reproducing issue #257
Updating the project

Using nullable types in type check, closes #257
755fe92
Jimmy Bogard jbogard closed this in 755fe92
Jimmy Bogard
Owner

Check out the prerelease drop - this should fix your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.