Better support for nested result maps when using dictionary -----------------------------------------------------------
Key: IBATISNET-254 URL: https://issues.apache.org/jira/browse/IBATISNET-254 Project: iBatis for .NET Issue Type: Bug Components: DataMapper Affects Versions: DataMapper 1.6.1 Reporter: Gilles Bayon Assignee: Gilles Bayon Fix For: DataMapper 1.6.2 If class for result map is dictionary (or inherits dictionary) it is not possible to use nested result maps to put complex objects into dictionary. The problem is in ResultProperty.MemberType property. Currently it is implemented like this: public virtual Type MemberType { get { return _setAccessor.MemberType; } } But if the class for result map is dictionary, _setAccessor is null then this getter is called from Get method of PropertyStrategyFactory class (line 88). We propose to change it to: public virtual Type MemberType { get { if (_setAccessor != null) { return _setAccessor.MemberType; } if (_nestedResultMap != null) { return _nestedResultMap.Class; } throw new IBatisNetException( String.Format(CultureInfo.InvariantCulture, "Could not resolve member type for result property '{0}'. Neither nested result map nor typed setter was provided.", _propertyName)); } } In this case if set accessor is not initialized yet but nested result map is set, class from nested result map is used. Maybe this getter can also consider CLRType if nothing else is provided. Currently we are using 'patched' version of iBATIS but we would like to get back to mainline when these issues are fixed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.