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)); }
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)); }
public static IQueryable <TSource> ThenInclude <TSource, TProperty, TSubProperty>( this IIncludeQueryable <TSource, TProperty> queryable, Expression <Func <TProperty, TSubProperty> > propertyExpression) { return(queryable); }