Skip to content

Commit fee1f97

Browse files
author
Donald L Mull Jr
committed
chore: disable literal checking
1 parent a38ccec commit fee1f97

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

src/AutoMapper.Extensions.ExpressionMapping/XpressionMapperVisitor.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -699,19 +699,19 @@ TypeMap GetTypeMap() => BothTypesAreAnonymous()
699699
if (propertyMap.CustomMapExpression == null && !propertyMap.SourceMembers.Any())
700700
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resource.srcMemberCannotBeNullFormat, typeSource.Name, typeDestination.Name, sourceFullName));
701701

702-
CompareSourceAndDestLiterals
703-
(
704-
propertyMap.CustomMapExpression != null ? propertyMap.CustomMapExpression.ReturnType : propertyMap.SourceMember.GetMemberType(),
705-
propertyMap.CustomMapExpression != null ? propertyMap.CustomMapExpression.ToString() : propertyMap.SourceMember.Name,
706-
sourceMemberInfo.GetMemberType()
707-
);
708-
709-
void CompareSourceAndDestLiterals(Type mappedPropertyType, string mappedPropertyDescription, Type sourceMemberType)
710-
{
711-
//switch from IsValueType to IsLiteralType because we do not want to throw an exception for all structs
712-
if ((mappedPropertyType.IsLiteralType() || sourceMemberType.IsLiteralType()) && sourceMemberType != mappedPropertyType)
713-
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resource.expressionMapValueTypeMustMatchFormat, mappedPropertyType.Name, mappedPropertyDescription, sourceMemberType.Name, propertyMap.GetDestinationName()));
714-
}
702+
// CompareSourceAndDestLiterals
703+
// (
704+
// propertyMap.CustomMapExpression != null ? propertyMap.CustomMapExpression.ReturnType : propertyMap.SourceMember.GetMemberType(),
705+
// propertyMap.CustomMapExpression != null ? propertyMap.CustomMapExpression.ToString() : propertyMap.SourceMember.Name,
706+
// sourceMemberInfo.GetMemberType()
707+
// );
708+
709+
// void CompareSourceAndDestLiterals(Type mappedPropertyType, string mappedPropertyDescription, Type sourceMemberType)
710+
// {
711+
// //switch from IsValueType to IsLiteralType because we do not want to throw an exception for all structs
712+
// if ((mappedPropertyType.IsLiteralType() || sourceMemberType.IsLiteralType()) && sourceMemberType != mappedPropertyType)
713+
// throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resource.expressionMapValueTypeMustMatchFormat, mappedPropertyType.Name, mappedPropertyDescription, sourceMemberType.Name, propertyMap.GetDestinationName()));
714+
// }
715715

716716
if (propertyMap.ProjectToCustomSource != null)
717717
propertyMapInfoList.Add(new PropertyMapInfo(propertyMap.ProjectToCustomSource, new List<MemberInfo>()));

0 commit comments

Comments
 (0)