@@ -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