private static IDataSource ApplyFilter(
            IQualifiedMember sourceMember,
            IDataSource dataSource,
            IMemberMapperData mapperData)
        {
            if (DoNotApplyFilter(sourceMember, dataSource, mapperData))
            {
                return(dataSource);
            }

            var filters = mapperData.GetSourceValueFilters(sourceMember.Type);

            if (filters.None())
            {
                return(dataSource);
            }

            var contextMapperData = mapperData.IsEntryPoint || (sourceMember != mapperData.SourceMember)
                ? mapperData
                : mapperData.Parent;

            var rawSourceValue = sourceMember
                                 .RelativeTo(contextMapperData.SourceMember)
                                 .GetQualifiedAccess(contextMapperData.SourceObject);

            var filterConditions = filters.GetFilterConditionsOrNull(rawSourceValue, contextMapperData);

            if (filterConditions == null)
            {
                return(dataSource);
            }

            if (dataSource.IsConditional)
            {
                filterConditions = Expression.AndAlso(dataSource.Condition, filterConditions);
            }

            return(new AdHocDataSource(sourceMember, dataSource.Value, filterConditions));
        }