@@ -37,8 +37,7 @@ public Task Started(Guid deviceId, int updateId, SemVersion version)
3737 public async Task Progress ( Guid deviceId , int updateId )
3838 {
3939 var updateTask = await _db . DeviceOtaUpdates
40- . Where ( x => x . DeviceId == deviceId && x . UpdateId == updateId )
41- . FirstOrDefaultAsync ( ) ;
40+ . FirstOrDefaultAsync ( x => x . DeviceId == deviceId && x . UpdateId == updateId ) ;
4241 if ( updateTask == null ) return ;
4342 updateTask . Status = OtaUpdateStatus . Running ;
4443
@@ -49,8 +48,7 @@ public async Task Progress(Guid deviceId, int updateId)
4948 public async Task Error ( Guid deviceId , int updateId , bool fatal , string message )
5049 {
5150 var updateTask = await _db . DeviceOtaUpdates
52- . Where ( x => x . DeviceId == deviceId && x . UpdateId == updateId )
53- . FirstOrDefaultAsync ( ) ;
51+ . FirstOrDefaultAsync ( x => x . DeviceId == deviceId && x . UpdateId == updateId ) ;
5452 if ( updateTask == null ) return ;
5553 updateTask . Status = OtaUpdateStatus . Error ;
5654 updateTask . Message = message ;
@@ -62,8 +60,7 @@ public async Task Error(Guid deviceId, int updateId, bool fatal, string message)
6260 public async Task < bool > Success ( Guid deviceId , int updateId )
6361 {
6462 var updateTask = await _db . DeviceOtaUpdates
65- . Where ( x => x . DeviceId == deviceId && x . UpdateId == updateId )
66- . FirstOrDefaultAsync ( ) ;
63+ . FirstOrDefaultAsync ( x => x . DeviceId == deviceId && x . UpdateId == updateId ) ;
6764 if ( updateTask == null ) return false ;
6865 updateTask . Status = OtaUpdateStatus . Finished ;
6966
0 commit comments