@@ -127,7 +127,7 @@ public async Task AddOrUpdateControl(string controlDataJson)
127
127
string controlId = document [ "ControlId" ] . AsString ;
128
128
string version = document [ "Version" ] . AsString ;
129
129
130
- document . Add ( "LastUpdated" , DateTime . Now . ToUniversalTime ( ) ) ;
130
+ document . Add ( "LastUpdated" , DateTime . UtcNow ) ;
131
131
132
132
//if document already exists, replace it
133
133
if ( controlsCollection . CountDocuments < BsonDocument > ( x => x [ "ApplicationId" ] . Equals ( applicationId )
@@ -169,7 +169,8 @@ public async Task DeleteControlAsync(string applicationId, string controlId)
169
169
{
170
170
throw new InvalidOperationException ( "Control is in use across one or more projects" ) ;
171
171
}
172
- var updateDefinition = Builders < BsonDocument > . Update . Set ( "IsDeleted" , true ) ;
172
+ var updateDefinition = Builders < BsonDocument > . Update . Set ( "IsDeleted" , true )
173
+ . Set ( "LastUpdated" , DateTime . UtcNow ) ;
173
174
await controlsCollection . FindOneAndUpdateAsync < BsonDocument > ( CreateControlFilter ( applicationId , controlId ) , updateDefinition ) ;
174
175
}
175
176
@@ -189,8 +190,7 @@ public async Task AddOrUpdateControlImage(ControlImageMetaData imageMetaData, by
189
190
{ "controlId" , imageMetaData . ControlId } ,
190
191
{ "version" , imageMetaData . Version . ToString ( ) }
191
192
}
192
- } ) ;
193
-
193
+ } ) ;
194
194
}
195
195
196
196
///<inheritdoc/>
@@ -213,6 +213,9 @@ public async Task DeleteImageAsync(ControlImageMetaData imageMetaData)
213
213
await imageBucket . DeleteAsync ( imageFile . Id ) ;
214
214
}
215
215
}
216
+
217
+ var updateDefinition = Builders < BsonDocument > . Update . Set ( "LastUpdated" , DateTime . UtcNow ) ;
218
+ await controlsCollection . FindOneAndUpdateAsync < BsonDocument > ( CreateControlFilter ( imageMetaData . ApplicationId , imageMetaData . ControlId , imageMetaData . Version ) , updateDefinition ) ;
216
219
}
217
220
218
221
/// <summary>
0 commit comments