File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
src/FitSyncHub.Functions/Functions Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 99using Microsoft . AspNetCore . Mvc ;
1010using Microsoft . AspNetCore . WebUtilities ;
1111using Microsoft . Azure . Cosmos ;
12+ using Microsoft . Azure . Cosmos . Linq ;
1213using Microsoft . Azure . Functions . Worker ;
1314using Microsoft . Extensions . Logging ;
1415using Microsoft . Extensions . Primitives ;
@@ -109,15 +110,10 @@ private static bool AllActiviesSynced(
109110
110111 private async Task < DateTime > GetLastSynchronizedDate ( CancellationToken cancellationToken )
111112 {
112- var query = new QueryDefinition (
113- """
114- SELECT top 1 * FROM c
115- ORDER BY c.date DESC
116- """ ) ;
117-
118- var feed = _everestingHOFContainer . GetItemQueryIterator < ActivityItemProjection > (
119- queryDefinition : query
120- ) ;
113+ var feed = _everestingHOFContainer . GetItemLinqQueryable < ActivityItemProjection > ( )
114+ . OrderByDescending ( x => x . Date )
115+ . Take ( 1 )
116+ . ToFeedIterator ( ) ;
121117
122118 while ( feed . HasMoreResults )
123119 {
You can’t perform that action at this time.
0 commit comments