public static bool IsRepeatMapping(this IQualifiedMemberContext context) { if (context.IsRoot || (context.TargetMember.Depth == 2)) { return(false); } if (context.TargetMember.IsRecursion) { return(true); } if ((context.TargetMember.Depth == 3) && context.TargetMemberIsEnumerableElement()) { return(false); } if (TargetMemberHasRecursiveObjectGraph(context.TargetMember) == false) { return(false); } // The target member we're mapping right now isn't recursive, but it has recursion // within its child members, and its mapping might be repeated elsewhere within the // mapping graph. We therefore check if this member ever repeats; if so we'll map it // by calling MapRepeated, and it'll be the entry point of the RepeatedMapperFunc // which performs the repeated mapping: var rootMember = context.GetRootMapperData().TargetMember; return(TargetMemberEverRepeatsWithin(rootMember, context.TargetMember)); }
private EnumMappingMismatch( IQualifiedMember targetMember, IEnumerable <IQualifiedMember> sourceMembers, IList <string> mismatches, IQualifiedMemberContext context) { _rootMapperData = context.GetRootMapperData(); _sourceMembers = sourceMembers; _mismatches = mismatches; TargetMemberPath = targetMember.GetFriendlyTargetPath(_rootMapperData); }