示例#1
0
        /// <summary>
        ///     Creates a group join include used to describe an Include operation that should
        ///     be performed as part of a GroupJoin.
        /// </summary>
        /// <param name="navigationPath"> The included navigation path. </param>
        /// <param name="querySourceRequiresTracking"> true if this query source requires tracking. </param>
        /// <param name="existingGroupJoinInclude"> A possibly null existing group join include. </param>
        /// <param name="relatedEntitiesLoaders"> The related entities loaders. </param>
        /// <returns>
        ///     A new group join include.
        /// </returns>
        public virtual object CreateGroupJoinInclude(
            IReadOnlyList <INavigation> navigationPath,
            bool querySourceRequiresTracking,
            object existingGroupJoinInclude,
            object relatedEntitiesLoaders)
        {
            Check.NotNull(navigationPath, nameof(navigationPath));
            Check.NotNull(relatedEntitiesLoaders, nameof(relatedEntitiesLoaders));

            var previousGroupJoinInclude
                = new AsyncGroupJoinInclude(
                      navigationPath,
                      (IReadOnlyList <Func <QueryContext, IAsyncRelatedEntitiesLoader> >)relatedEntitiesLoaders,
                      querySourceRequiresTracking);

            var groupJoinInclude = existingGroupJoinInclude as AsyncGroupJoinInclude;

            if (groupJoinInclude != null)
            {
                groupJoinInclude.SetPrevious(previousGroupJoinInclude);

                return(null);
            }

            return(previousGroupJoinInclude);
        }
示例#2
0
 private static IAsyncEnumerable <TResult> _GroupJoin <TOuter, TInner, TKey, TResult>(
     RelationalQueryContext queryContext,
     IAsyncEnumerable <ValueBuffer> source,
     IShaper <TOuter> outerShaper,
     IShaper <TInner> innerShaper,
     Func <TInner, TKey> innerKeySelector,
     Func <TOuter, IAsyncEnumerable <TInner>, TResult> resultSelector,
     AsyncGroupJoinInclude outerGroupJoinInclude,
     AsyncGroupJoinInclude innerGroupJoinInclude)
 => new GroupJoinAsyncEnumerable <TOuter, TInner, TKey, TResult>(
     queryContext,
     source,
     outerShaper,
     innerShaper,
     innerKeySelector,
     resultSelector,
     outerGroupJoinInclude,
     innerGroupJoinInclude);
 public GroupJoinAsyncEnumerable(
     RelationalQueryContext queryContext,
     IAsyncEnumerable <ValueBuffer> source,
     IShaper <TOuter> outerShaper,
     IShaper <TInner> innerShaper,
     Func <TInner, TKey> innerKeySelector,
     Func <TOuter, IAsyncEnumerable <TInner>, TResult> resultSelector,
     AsyncGroupJoinInclude outerGroupJoinInclude,
     AsyncGroupJoinInclude innerGroupJoinInclude)
 {
     _queryContext          = queryContext;
     _source                = source;
     _outerShaper           = outerShaper;
     _innerShaper           = innerShaper;
     _innerKeySelector      = innerKeySelector;
     _resultSelector        = resultSelector;
     _outerGroupJoinInclude = outerGroupJoinInclude;
     _innerGroupJoinInclude = innerGroupJoinInclude;
 }