Fix Retrieve updated document in ReplaceOneAsync method

This commit is contained in:
2025-08-07 17:23:44 -06:00
parent a97e4e2219
commit dbc21959eb
2 changed files with 22 additions and 9 deletions

View File

@@ -104,11 +104,13 @@ namespace Core.Blueprint.Mongo
void ReplaceOne(TDocument document);
/// <summary>
/// Asynchronously replaces an existing document with a new one.
/// Asynchronously replaces an existing document in the collection and returns the updated version.
/// </summary>
/// <param name="document">The document to replace the existing one.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task ReplaceOneAsync(TDocument document);
/// <param name="document">The document with the updated data. Its _Id is used to locate the existing document.</param>
/// <returns>
/// The updated document if the replacement was successful; otherwise, <c>null</c> if no matching document was found.
/// </returns>
Task<TDocument?> ReplaceOneAsync(TDocument document);
/// <summary>
/// Deletes a single document by the provided filter expression.