@@ -43,6 +43,7 @@ private SortExpression CreateSortFromExpressionSyntax()
43
43
{
44
44
AttrAttribute paintColorAttribute = ResourceGraph . GetResourceType < ChromeWheel > ( ) . GetAttributeByPropertyName ( nameof ( ChromeWheel . PaintColor ) ) ;
45
45
AttrAttribute hasTubeAttribute = ResourceGraph . GetResourceType < CarbonWheel > ( ) . GetAttributeByPropertyName ( nameof ( CarbonWheel . HasTube ) ) ;
46
+ AttrAttribute idAttribute = ResourceGraph . GetResourceType < Wheel > ( ) . GetAttributeByPropertyName ( nameof ( Wheel . Id ) ) ;
46
47
47
48
var cylinderCountChain = new ResourceFieldChainExpression ( ImmutableArray . Create < ResourceFieldAttribute > (
48
49
ResourceGraph . GetResourceType < Wheel > ( ) . GetRelationshipByPropertyName ( nameof ( Wheel . Vehicle ) ) ,
@@ -53,7 +54,8 @@ private SortExpression CreateSortFromExpressionSyntax()
53
54
{
54
55
new SortElementExpression ( new ResourceFieldChainExpression ( paintColorAttribute ) , true ) ,
55
56
new SortElementExpression ( new ResourceFieldChainExpression ( hasTubeAttribute ) , false ) ,
56
- new SortElementExpression ( new CountExpression ( cylinderCountChain ) , true )
57
+ new SortElementExpression ( new CountExpression ( cylinderCountChain ) , true ) ,
58
+ new SortElementExpression ( new ResourceFieldChainExpression ( idAttribute ) , true )
57
59
} . ToImmutableArray ( ) ) ;
58
60
}
59
61
@@ -63,7 +65,8 @@ private SortExpression CreateSortFromLambdaSyntax()
63
65
{
64
66
( wheel => ( wheel as ChromeWheel ) ! . PaintColor , ListSortDirection . Ascending ) ,
65
67
( wheel => ( ( CarbonWheel ) wheel ) . HasTube , ListSortDirection . Descending ) ,
66
- ( wheel => ( ( GasolineEngine ) ( ( Car ) wheel . Vehicle ! ) . Engine ) . Cylinders . Count , ListSortDirection . Ascending )
68
+ ( wheel => ( ( GasolineEngine ) ( ( Car ) wheel . Vehicle ! ) . Engine ) . Cylinders . Count , ListSortDirection . Ascending ) ,
69
+ ( wheel => wheel . Id , ListSortDirection . Ascending )
67
70
} ) ;
68
71
}
69
72
}
0 commit comments