-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
Hi,
Our code broke when updating to 6.1.0 from 6.0.2 and I am pretty sure the reason is this change:
#2115
We map from a Nullable bool to a class and originally it invoked the following:
public QuestionState(bool? asBool) : this(StateFromNullBool(asBool))
{
}
Where we set an internal enum based on the setting of the bool:
public static QuestionStates StateFromNullBool(bool? asBool)
{
if (asBool == null)
{
return QuestionStates.Na;
}
return asBool.Value ? QuestionStates.Yes : QuestionStates.No;
}
However now, I think due to the change above, it never goes into that constructor, when the bool is null, instead it appears to be setting the Question State itself to null. Which we don't want, is there any way we can override this behavior?
-Thanks, Chris
Source/destination types
// Put your source/destination types here
Mapping configuration
// Mapper.Initialize or just the CreateMap snippet
Version: x.y.z
Expected behavior
Actual behavior
Steps to reproduce
// Your calls to Mapper.Map or ProjectTo here, with source/destination objects constructed
Metadata
Metadata
Assignees
Labels
No labels