예제 #1
0
        public IEnumerable <IDataSource> FindFor(DataSourceFindContext context)
        {
            if (TryGetMetaMemberNameParts(context, out var memberNameParts) &&
                TryGetMetaMember(memberNameParts, context, out var metaMember))
            {
                var dataSource = metaMember.GetDataSource();

                yield return(context.GetFinalDataSource(dataSource));

                if (dataSource.IsConditional)
                {
                    yield return(context.GetFallbackDataSource());
                }
            }
        }
예제 #2
0
        private static IDataSource GetSourceMemberDataSourceOrNull(DataSourceFindContext context)
        {
            var bestMatchingSourceMember = SourceMemberMatcher.GetMatchFor(
                context.ChildMappingData,
                out var contextMappingData);

            if (bestMatchingSourceMember == null)
            {
                return(null);
            }

            var sourceMemberDataSource = SourceMemberDataSource
                                         .For(bestMatchingSourceMember, contextMappingData.MapperData);

            return(context.GetFinalDataSource(sourceMemberDataSource, contextMappingData));
        }
예제 #3
0
        public IEnumerable <IDataSource> FindFor(DataSourceFindContext context)
        {
            if (context.ConfiguredDataSources.None())
            {
                yield break;
            }

            foreach (var configuredDataSource in context.ConfiguredDataSources)
            {
                yield return(context.GetFinalDataSource(configuredDataSource));

                if (!configuredDataSource.IsConditional)
                {
                    yield break;
                }

                ++context.DataSourceIndex;
            }
        }
예제 #4
0
        public IEnumerable <IDataSource> FindFor(DataSourceFindContext context)
        {
            if (!UseMaptimeDataSources(context, out var maptimeDataSources))
            {
                yield break;
            }

            context.StopFind = true;

            foreach (var maptimeDataSource in maptimeDataSources)
            {
                yield return(context.GetFinalDataSource(maptimeDataSource));

                if (maptimeDataSource.IsConditional)
                {
                    continue;
                }

                yield break;
            }

            yield return(context.GetFallbackDataSource());
        }