예제 #1
0
        /// <summary>
        /// DO NOT USE THIS OVERLOAD (Ienumerable) with EntityFramework or Database-related logic, since it will directly enumerate the query to database.
        /// In order to ensure that your query works on your database, USE IQUERYABLE OVERLOAD
        /// </summary>
        public static IEnumerable <TResult> RightJoinExtEnumerable <TLeft, TRight, TKey, TResult>(
            this IEnumerable <TLeft> left,
            IEnumerable <TRight> right,
            Func <TLeft, TKey> leftKey,
            Func <TRight, TKey> rightKey,
            Func <TLeft, TRight, TResult> resultFunc
            )
        {
            var query = EnumerableLeftJoinExtensions.LeftJoinExtEnumerable(right, left, rightKey, leftKey, (i, o) => resultFunc(o, i));

            return(query);
        }
예제 #2
0
        /// <summary>
        /// DO NOT USE THIS OVERLOAD (Ienumerable) with EntityFramework or Database-related logic, since it will directly enumerate the query to database.
        /// In order to ensure that your query works on your database, USE IQUERYABLE OVERLOAD
        /// </summary>
        public static IEnumerable <JoinItem <TLeft, TRight> > InnerJoinExtEnumerable <TLeft, TRight, TKey>(
            this IEnumerable <TLeft> left,
            IEnumerable <TRight> right,
            Func <TLeft, TKey> leftKey,
            Func <TRight, TKey> rightKey
            )
        {
            var result = EnumerableLeftJoinExtensions.LeftJoinExtEnumerable(left, right, leftKey, rightKey)
                         .Where(a => a.Right != null)
            ;

            return(result);
        }
        public static IEnumerable <TResult> FullOuterJoinExtEnumerable <TLeft, TRight, TKey, TResult>(
            this IEnumerable <TLeft> left,
            IEnumerable <TRight> right,
            Func <TLeft, TKey> leftKey,
            Func <TRight, TKey> rightKey,
            Func <TLeft, TRight, TResult> result)
            where TLeft : class where TRight : class
        {
            var leftResult  = EnumerableLeftJoinExtensions.LeftJoinExtEnumerable(left, right, leftKey, rightKey, result);
            var rightResult = EnumerableRightJoinExtensions.RightJoinExtEnumerable(left, right, leftKey, rightKey, result);

            return(leftResult.Union(rightResult));
        }
예제 #4
0
        /// <summary>
        /// DO NOT USE THIS OVERLOAD (Ienumerable) with EntityFramework or Database-related logic, since it will directly enumerate the query to database.
        /// In order to ensure that your query works on your database, USE IQUERYABLE OVERLOAD
        /// </summary>
        public static IEnumerable <TResult> InnerJoinExtEnumerable <TLeft, TRight, TKey, TResult>(
            this IEnumerable <TLeft> left,
            IEnumerable <TRight> right,
            Func <TLeft, TKey> leftKey,
            Func <TRight, TKey> rightKey,
            Func <TLeft, TRight, TResult> resultFunc
            )
        {
            var result = EnumerableLeftJoinExtensions.LeftJoinExtEnumerable(left, right, leftKey, rightKey)
                         .Where(a => a.Right != null)
                         .Select(a => resultFunc(a.Left, a.Right))
            ;

            return(result);
        }