コード例 #1
0
 public static IIncludeQueryable <TEntity, TProperty> ThenInclude <TEntity, TPreviousProperty, TProperty>(this IIncludeQueryable <TEntity, TPreviousProperty> query, Expression <Func <TPreviousProperty, TProperty> > path) where TEntity : class
 {
     return(OrmHelper.ThenInclude(query, path));
 }
コード例 #2
0
        public IIncludeQueryable <TEntity, TProperty> ThenInclude <TEntity, TPreviousProperty, TProperty>(IIncludeQueryable <TEntity, TPreviousProperty> query, Expression <Func <TPreviousProperty, TProperty> > path) where TEntity : class
        {
            var propertyName = ((MemberExpression)path.Body).Member.Name;
            var previousPropertyExpression  = Expression.Parameter(typeof(TPreviousProperty));
            var includingPropertyExpression = Expression.Convert(Expression.Property(previousPropertyExpression, propertyName), typeof(TProperty));
            var includeQuery = query.Queryable as IIncludableQueryable <TEntity, TPreviousProperty>;
            var queryable    = includeQuery.ThenInclude(Expression.Lambda <Func <TPreviousProperty, TProperty> >(includingPropertyExpression, previousPropertyExpression));

            return(new IncludeQueryable <TEntity, TProperty>(queryable));
        }
コード例 #3
0
 public static IQueryable <TSource> ThenInclude <TSource, TProperty, TSubProperty>(
     this IIncludeQueryable <TSource, TProperty> queryable,
     Expression <Func <TProperty, TSubProperty> > propertyExpression)
 {
     return(queryable);
 }