public static bool TargetMemberIsUnmappable <TTMapperData>( this TTMapperData mapperData, QualifiedMember targetMember, Func <TTMapperData, IEnumerable <ConfiguredDataSourceFactory> > configuredDataSourcesFactory, UserConfigurationSet userConfigurations, out string reason) where TTMapperData : IBasicMapperData { if (targetMember == QualifiedMember.All) { reason = null; return(false); } if (!targetMember.LeafMember.IsEntityId() || userConfigurations.MapEntityKeys(mapperData) || configuredDataSourcesFactory.Invoke(mapperData).Any()) { return(targetMember.IsUnmappable(out reason)); } // If we're here: // 1. TargetMember is an Entity key // 2. No configuration exists to allow Entity key Mapping // 3. No configured data sources exist if (mapperData.RuleSet.Settings.AllowCloneEntityKeyMapping && (mapperData.SourceType == mapperData.TargetType)) { return(targetMember.IsUnmappable(out reason)); } reason = "Entity key member"; return(true); }
public static bool TargetMemberIsUnmappable <TTMapperData>( this TTMapperData mapperData, QualifiedMember targetMember, Func <TTMapperData, IEnumerable <ConfiguredDataSourceFactory> > configuredDataSourcesFactory, UserConfigurationSet userConfigurations, out string reason) where TTMapperData : IBasicMapperData { if (targetMember == QualifiedMember.All) { reason = null; return(false); } if ((mapperData.TargetType != mapperData.SourceType) && targetMember.LeafMember.IsEntityId() && !userConfigurations.MapEntityKeys(mapperData) && configuredDataSourcesFactory.Invoke(mapperData).None()) { reason = "Entity key member"; return(true); } return(targetMember.IsUnmappable(out reason)); }
public static bool TargetMemberIsUnmappable <TTypePair>( this TTypePair typePair, QualifiedMember targetMember, Func <TTypePair, IEnumerable <ConfiguredDataSourceFactory> > configuredDataSourcesFactory, out string reason) where TTypePair : ITypePair { if (targetMember == QualifiedMember.All) { reason = null; return(false); } if ((typePair.TargetType != typePair.SourceType) && targetMember.LeafMember.IsEntityId() && configuredDataSourcesFactory.Invoke(typePair).None()) { reason = "Entity key member"; return(true); } return(targetMember.IsUnmappable(out reason)); }