|
9395 | 9395 | an <see cref="T:System.Linq.Expressions.Expression"/>.
|
9396 | 9396 | </summary>
|
9397 | 9397 | </member>
|
9398 |
| - <member name="M:Microsoft.AspNetCore.OData.Query.Expressions.IAggregationBinder.FlattenReferencedProperties(Microsoft.OData.UriParser.Aggregation.TransformationNode,System.Linq.IQueryable,Microsoft.AspNetCore.OData.Query.Expressions.QueryBinderContext)"> |
9399 |
| - <summary> |
9400 |
| - Flattens properties referenced in aggregate clause to avoid generation of nested queries by Entity Framework. |
9401 |
| - </summary> |
9402 |
| - <param name="transformationNode">The OData $apply parse tree represented by <see cref="T:Microsoft.OData.UriParser.Aggregation.TransformationNode"/>.</param> |
9403 |
| - <param name="query">The original <see cref="T:System.Linq.IQueryable"/>.</param> |
9404 |
| - <param name="context">An instance of the <see cref="T:Microsoft.AspNetCore.OData.Query.Expressions.QueryBinderContext"/> containing the current query context.</param> |
9405 |
| - <returns> |
9406 |
| - An <see cref="T:Microsoft.AspNetCore.OData.Query.Expressions.AggregationFlatteningResult"/> containing the modified query source and |
9407 |
| - additional metadata resulting from the flattening operation. |
9408 |
| - </returns> |
9409 |
| - <remarks> |
9410 |
| - This method generates a Select expression that flattens the properties referenced in the aggregate clause. |
9411 |
| - Flattening properties helps prevent the generation of nested queries by Entity Framework, |
9412 |
| - resulting in more efficient SQL generation. |
9413 |
| - For query like: |
9414 |
| - <code> |
9415 |
| - groupby((A),aggregate(B/C with max as Alias1,B/D with max as Alias2)) |
9416 |
| - </code> |
9417 |
| - generate an expression similar to: |
9418 |
| - <code> |
9419 |
| - $it => new FlatteningWrapper() { |
9420 |
| - Source = $it, |
9421 |
| - Container = new { |
9422 |
| - Value = $it.B.C |
9423 |
| - Next = new { |
9424 |
| - Value = $it.B.D |
9425 |
| - } |
9426 |
| - } |
9427 |
| - } |
9428 |
| - </code> |
9429 |
| - Also populate expressions to access B/C and B/D in aggregate stage to look like: |
9430 |
| - B/C : $it.Container.Value |
9431 |
| - B/D : $it.Container.Next.Value |
9432 |
| - </remarks> |
9433 |
| - </member> |
9434 | 9398 | <member name="M:Microsoft.AspNetCore.OData.Query.Expressions.IAggregationBinder.BindGroupBy(Microsoft.OData.UriParser.Aggregation.TransformationNode,Microsoft.AspNetCore.OData.Query.Expressions.QueryBinderContext)">
|
9435 | 9399 | <summary>
|
9436 | 9400 | Translates an OData $apply parse tree represented by a <see cref="T:Microsoft.OData.UriParser.Aggregation.TransformationNode"/> to
|
|
9529 | 9493 | <returns>The filter binder result.</returns>
|
9530 | 9494 | <remarks>reconsider to return "LambdaExpression"? </remarks>
|
9531 | 9495 | </member>
|
| 9496 | + <member name="T:Microsoft.AspNetCore.OData.Query.Expressions.IFlatteningBinder"> |
| 9497 | + <summary> |
| 9498 | + Provides an abstraction for flattening property access expressions within an OData $apply clause |
| 9499 | + to support efficient translation of aggregation pipelines in LINQ providers like Entity Framework. |
| 9500 | + </summary> |
| 9501 | + <remarks> |
| 9502 | + Entity Framework versions earlier than EF Core 6.0 may generate nested queries when accessing navigation properties |
| 9503 | + in aggregation clauses. Flattening these properties can help generate flatter, more efficient SQL queries. |
| 9504 | + This interface allows conditional support for flattening based on the capabilities of the underlying LINQ provider. |
| 9505 | + </remarks> |
| 9506 | + </member> |
| 9507 | + <member name="M:Microsoft.AspNetCore.OData.Query.Expressions.IFlatteningBinder.FlattenReferencedProperties(Microsoft.OData.UriParser.Aggregation.TransformationNode,System.Linq.IQueryable,Microsoft.AspNetCore.OData.Query.Expressions.QueryBinderContext)"> |
| 9508 | + <summary> |
| 9509 | + Flattens properties referenced in aggregate clause to avoid generation of nested queries by Entity Framework. |
| 9510 | + </summary> |
| 9511 | + <param name="transformationNode">The OData $apply parse tree represented by <see cref="T:Microsoft.OData.UriParser.Aggregation.TransformationNode"/>.</param> |
| 9512 | + <param name="query">The original <see cref="T:System.Linq.IQueryable"/>.</param> |
| 9513 | + <param name="context">An instance of the <see cref="T:Microsoft.AspNetCore.OData.Query.Expressions.QueryBinderContext"/> containing the current query context.</param> |
| 9514 | + <returns> |
| 9515 | + An <see cref="T:Microsoft.AspNetCore.OData.Query.Expressions.AggregationFlatteningResult"/> containing the modified query source and |
| 9516 | + additional metadata resulting from the flattening operation. |
| 9517 | + </returns> |
| 9518 | + <remarks> |
| 9519 | + This method generates a Select expression that flattens the properties referenced in the aggregate clause. |
| 9520 | + Flattening properties helps prevent the generation of nested queries by Entity Framework, |
| 9521 | + resulting in more efficient SQL generation. |
| 9522 | + For query like: |
| 9523 | + <code> |
| 9524 | + groupby((A),aggregate(B/C with max as Alias1,B/D with max as Alias2)) |
| 9525 | + </code> |
| 9526 | + generate an expression similar to: |
| 9527 | + <code> |
| 9528 | + $it => new FlatteningWrapper() { |
| 9529 | + Source = $it, |
| 9530 | + Container = new { |
| 9531 | + Value = $it.B.C |
| 9532 | + Next = new { |
| 9533 | + Value = $it.B.D |
| 9534 | + } |
| 9535 | + } |
| 9536 | + } |
| 9537 | + </code> |
| 9538 | + Also populate expressions to access B/C and B/D in aggregate stage to look like: |
| 9539 | + B/C : $it.Container.Value |
| 9540 | + B/D : $it.Container.Next.Value |
| 9541 | + </remarks> |
| 9542 | + </member> |
9532 | 9543 | <member name="T:Microsoft.AspNetCore.OData.Query.Expressions.IOrderByBinder">
|
9533 | 9544 | <summary>
|
9534 | 9545 | Exposes the ability to translate an OData $orderby represented by <see cref="T:Microsoft.OData.UriParser.OrderByClause"/> to the <see cref="T:System.Linq.Expressions.Expression"/>
|
|
13318 | 13329 | Validates that the provided type implements <see cref="T:Microsoft.AspNetCore.OData.Query.Wrapper.IGroupByWrapper`2"/> and <see cref="T:Microsoft.AspNetCore.OData.Query.Wrapper.IFlatteningWrapper`1"/>, and inherits from <see cref="T:Microsoft.AspNetCore.OData.Query.Wrapper.DynamicTypeWrapper"/>.
|
13319 | 13330 | </summary>
|
13320 | 13331 | <param name="flattenedExpressionType">The type representing the flattened expression returned by
|
13321 |
| - <see cref="M:Microsoft.AspNetCore.OData.Query.Expressions.IAggregationBinder.FlattenReferencedProperties(Microsoft.OData.UriParser.Aggregation.TransformationNode,System.Linq.IQueryable,Microsoft.AspNetCore.OData.Query.Expressions.QueryBinderContext)"/>.</param> |
| 13332 | + <see cref="M:Microsoft.AspNetCore.OData.Query.Expressions.IFlatteningBinder.FlattenReferencedProperties(Microsoft.OData.UriParser.Aggregation.TransformationNode,System.Linq.IQueryable,Microsoft.AspNetCore.OData.Query.Expressions.QueryBinderContext)"/>.</param> |
13322 | 13333 | <exception cref="T:System.InvalidOperationException">Thrown if <paramref name="flattenedExpressionType"/>
|
13323 | 13334 | does not implement the required interfaces or inherit from the required base class.</exception>
|
13324 | 13335 | </member>
|
|
0 commit comments