File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
test/EFCore.Specification.Tests/Query Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -3009,6 +3009,33 @@ public virtual Task GroupBy_scalar_aggregate_in_set_operation(bool async)
3009
3009
elementSorter: e => ( e . CustomerID , e . Sequence ) ) ;
3010
3010
}
3011
3011
3012
+ [ ConditionalTheory ]
3013
+ [ MemberData ( nameof ( IsAsyncData ) ) ]
3014
+ public virtual Task AsEnumerable_in_subquery_for_GroupBy ( bool async )
3015
+ {
3016
+ return AssertTranslationFailed (
3017
+ ( ) => AssertQuery (
3018
+ async ,
3019
+ ss => ss . Set < Customer > ( )
3020
+ . Where ( c => c . CustomerID . StartsWith ( "F" ) )
3021
+ . Select ( c => new
3022
+ {
3023
+ Customer = c ,
3024
+ Orders = ss . Set < Order > ( )
3025
+ . Where ( o => o . CustomerID == c . CustomerID )
3026
+ . AsEnumerable ( )
3027
+ . GroupBy ( o => o . CustomerID )
3028
+ . Select ( g => g . OrderByDescending ( e => e . OrderDate ) . FirstOrDefault ( ) )
3029
+ . ToList ( )
3030
+ } ) ,
3031
+ elementSorter : e => e . Customer . CustomerID ,
3032
+ elementAsserter : ( e , a ) =>
3033
+ {
3034
+ AssertEqual ( e . Customer , a . Customer ) ;
3035
+ AssertCollection ( e . Orders , a . Orders ) ;
3036
+ } ) ) ;
3037
+ }
3038
+
3012
3039
#endregion
3013
3040
}
3014
3041
}
You can’t perform that action at this time.
0 commit comments