/// <summary> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </summary> protected override void ApplyNodeSpecificSemantics( QueryModel queryModel, ClauseGenerationContext clauseGenerationContext) { var includeResultOperator = (IncludeResultOperator)clauseGenerationContext.GetContextInfo(Source); includeResultOperator .AppendToNavigationPath( NavigationPropertyPathLambda.GetComplexPropertyAccess( nameof(EntityFrameworkQueryableExtensions.ThenInclude))); clauseGenerationContext.AddContextInfo(this, includeResultOperator); }
/// <summary> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </summary> protected override ResultOperatorBase CreateResultOperator(ClauseGenerationContext clauseGenerationContext) { var prm = Expression.Parameter(typeof(object)); var pathFromQuerySource = Resolve(prm, prm, clauseGenerationContext); if (!(NavigationPropertyPathLambda.Body is MemberExpression navigationPropertyPath)) { throw new InvalidOperationException( CoreStrings.InvalidIncludeLambdaExpression( nameof(EntityFrameworkQueryableExtensions.Include), NavigationPropertyPathLambda)); } var includeResultOperator = new IncludeResultOperator( NavigationPropertyPathLambda.GetComplexPropertyAccess( nameof(EntityFrameworkQueryableExtensions.Include)) .Select(p => p.Name), pathFromQuerySource); clauseGenerationContext.AddContextInfo(this, includeResultOperator); return(includeResultOperator); }