Fixed
Details
Details
Assignee
Unassigned
UnassignedReporter
byrona
byrona(Deactivated)Components
Fix versions
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created April 27, 2017 at 5:37 AM
Updated May 2, 2017 at 9:57 AM
Resolved May 2, 2017 at 9:57 AM
We have found a need within our code to be able to map non-public parents and composite element relations. Methods with a string parameter
notVisiblePropertyOrFieldName
are available on other customizers but not on theComponentElementCustomizer
class.The proposed change would add the following interface methods:
Line 20: IComponentElementMapper<TComponent> interface, insert the following code:
void Property(string notVisiblePropertyOrFieldName, Action<IPropertyMapper> mapping);
IComponentMapper.cs, line 24,
IComponentsAttributeMapper<TComponent>
interface, insert the following code:void Parent(string notVisiblePropertyOrFieldName, Action<IComponentParentMapper> mapping);
Proposed implementation for first of them:
In ComponentElementCustomizer.cs, line 70, insert the following code:
public void Property(string notVisiblePropertyOrFieldName, Action<IPropertyMapper> mapping) { MemberInfo member = GetPropertyOrFieldMatchingNameOrThrow(notVisiblePropertyOrFieldName); MemberInfo memberOf = member.GetMemberFromReflectedType(typeof(TComponent)); _customizersHolder.AddCustomizer(new PropertyPath(_propertyPath, member), mapping); _explicitDeclarationsHolder.AddAsProperty(memberOf); }