コード例 #1
0
        private void AddReverse(ConfiguredDataSourceFactory dataSourceFactory, bool isAutoReversal)
        {
            var reverseDataSourceFactory = dataSourceFactory.CreateReverseIfAppropriate(isAutoReversal);

            if (reverseDataSourceFactory != null)
            {
                DataSourceFactories.AddOrReplaceThenSort(reverseDataSourceFactory);
            }
        }
コード例 #2
0
        public string GetConflictMessage(ConfiguredDataSourceFactory conflictingDataSource)
        {
            if (HasMemberFilter)
            {
                return($"Member ignore pattern '{TargetMemberFilter}' conflicts with a configured data source");
            }

            return($"Ignored member {TargetMember.GetPath()} has a configured data source");
        }
コード例 #3
0
        public void Add(ConfiguredDataSourceFactory dataSourceFactory)
        {
            ThrowIfConflictingIgnoredMemberExists(
                dataSourceFactory,
                dsf => "Member " + dsf.TargetMember.GetPath() + " has been ignored");

            ThrowIfConflictingDataSourceExists(
                dataSourceFactory,
                dsf => dsf.TargetMember.GetPath() + " already has a configured data source");

            _dataSourceFactories.Add(dataSourceFactory);
        }
コード例 #4
0
        public void Add(ConfiguredDataSourceFactory dataSourceFactory)
        {
            if (!dataSourceFactory.TargetMember.IsRoot)
            {
                ThrowIfConflictingIgnoredMemberExists(dataSourceFactory);
                ThrowIfConflictingDataSourceExists(dataSourceFactory, (dsf, cDsf) => dsf.GetConflictMessage(cDsf));
            }

            DataSourceFactories.AddSortFilter(dataSourceFactory);

            if (!HasConfiguredRootDataSources && dataSourceFactory.TargetMember.IsRoot)
            {
                HasConfiguredRootDataSources = true;
            }
        }
コード例 #5
0
        public void Add(ConfiguredDataSourceFactory dataSourceFactory)
        {
            if (!dataSourceFactory.TargetMember.IsRoot)
            {
                ThrowIfConflictingIgnoredMemberExists(dataSourceFactory);
                ThrowIfConflictingDataSourceExists(dataSourceFactory, (dsf, cDsf) => dsf.GetConflictMessage(cDsf));
            }

            DataSourceFactories.AddOrReplaceThenSort(dataSourceFactory);

            if (dataSourceFactory.TargetMember.IsRoot)
            {
                HasConfiguredToTargetDataSources = true;
                return;
            }

            if (AutoDataSourceReversalEnabled(dataSourceFactory))
            {
                AddReverse(dataSourceFactory, isAutoReversal: true);
            }
        }
コード例 #6
0
 public abstract string GetConflictMessage(ConfiguredDataSourceFactory conflictingDataSource);
コード例 #7
0
 public override string GetConflictMessage(ConfiguredDataSourceFactory conflictingDataSource)
 => $"Member ignore pattern '{TargetMemberFilter}' conflicts with a configured data source";
コード例 #8
0
 public bool AutoDataSourceReversalEnabled(ConfiguredDataSourceFactory dataSourceFactory)
 => AutoDataSourceReversalEnabled(dataSourceFactory, dsf => dsf.ConfigInfo.ToMapperData(dsf.TargetMember));
コード例 #9
0
 public void AddReverseDataSourceFor(ConfiguredDataSourceFactory dataSourceFactory)
 => AddReverse(dataSourceFactory, isAutoReversal: false);
コード例 #10
0
 private static string GetConflictMessage(
     CustomDictionaryKey key,
     ConfiguredDataSourceFactory conflictingDataSource)
 {
     return(key.GetConflictMessage(conflictingDataSource));
 }
コード例 #11
0
 public override string GetConflictMessage(ConfiguredDataSourceFactory conflictingDataSource)
 => $"Ignored member {TargetMember.GetPath()} has a configured data source";
コード例 #12
0
 public string GetConflictMessage(ConfiguredDataSourceFactory conflictingDataSource)
 => $"Configured dictionary key member {TargetMember.GetPath()} has a configured data source";