@@ -386,7 +386,7 @@ private async Task<TableInsertManyResult> RunInsertManyAsync(IEnumerable<T> rows
386386 /// Synchronous version of <see cref="InsertOneAsync(T)"/>
387387 /// </summary>
388388 /// <inheritdoc cref="InsertOneAsync(T)"/>
389- public TableInsertManyResult InsertOne ( T row )
389+ public TableInsertOneResult InsertOne ( T row )
390390 {
391391 return InsertOne ( row , null ) ;
392392 }
@@ -395,7 +395,7 @@ public TableInsertManyResult InsertOne(T row)
395395 /// Synchronous version of <see cref="InsertOneAsync(T, CommandOptions)"/>
396396 /// </summary>
397397 /// <inheritdoc cref="InsertOneAsync(T, CommandOptions)"/>
398- public TableInsertManyResult InsertOne ( T row , CommandOptions commandOptions )
398+ public TableInsertOneResult InsertOne ( T row , CommandOptions commandOptions )
399399 {
400400 return InsertOneAsync ( row , commandOptions , true ) . ResultSync ( ) ;
401401 }
@@ -405,27 +405,27 @@ public TableInsertManyResult InsertOne(T row, CommandOptions commandOptions)
405405 /// </summary>
406406 /// <param name="row"></param>
407407 /// <returns></returns>
408- public Task < TableInsertManyResult > InsertOneAsync ( T row )
408+ public Task < TableInsertOneResult > InsertOneAsync ( T row )
409409 {
410410 return InsertOneAsync ( row , null ) ;
411411 }
412412
413413 /// <inheritdoc cref="InsertOneAsync(T)"/>
414414 /// <param name="commandOptions"></param>
415- public Task < TableInsertManyResult > InsertOneAsync ( T row , CommandOptions commandOptions )
415+ public Task < TableInsertOneResult > InsertOneAsync ( T row , CommandOptions commandOptions )
416416 {
417417 return InsertOneAsync ( row , commandOptions , false ) ;
418418 }
419419
420- private async Task < TableInsertManyResult > InsertOneAsync ( T row , CommandOptions commandOptions , bool runSynchronously )
420+ private async Task < TableInsertOneResult > InsertOneAsync ( T row , CommandOptions commandOptions , bool runSynchronously )
421421 {
422422 var payload = new
423423 {
424424 document = row ,
425425 } ;
426426 commandOptions = SetRowSerializationOptions < T > ( commandOptions , true ) ;
427427 var command = CreateCommand ( "insertOne" ) . WithPayload ( payload ) . AddCommandOptions ( commandOptions ) ;
428- var response = await command . RunAsyncReturnStatus < TableInsertManyResult > ( runSynchronously ) . ConfigureAwait ( false ) ;
428+ var response = await command . RunAsyncReturnStatus < TableInsertOneResult > ( runSynchronously ) . ConfigureAwait ( false ) ;
429429 return response . Result ;
430430 }
431431
@@ -738,105 +738,52 @@ private CommandOptions SetRowSerializationOptions<TResult>(CommandOptions comman
738738 return commandOptions ;
739739 }
740740
741- /// <summary>
742- /// Synchronous version of <see cref="UpdateOneAsync(UpdateBuilder{T}, UpdateOneOptions{T})"/>
743- /// </summary>
744- /// <inheritdoc cref="UpdateOneAsync(UpdateBuilder{T}, UpdateOneOptions{T})"/>
745- public UpdateResult UpdateOne ( UpdateBuilder < T > update , UpdateOneOptions < T > updateOptions )
746- {
747- return UpdateOne ( null , update , updateOptions , null ) ;
748- }
749-
750- /// <summary>
751- /// Synchronous version of <see cref="UpdateOneAsync(UpdateBuilder{T}, UpdateOneOptions{T}, CommandOptions)"/>
752- /// </summary>
753- /// <inheritdoc cref="UpdateOneAsync(UpdateBuilder{T}, UpdateOneOptions{T}, CommandOptions)"/>
754- public UpdateResult UpdateOne ( UpdateBuilder < T > update , UpdateOneOptions < T > updateOptions , CommandOptions commandOptions )
755- {
756- return UpdateOne ( null , update , updateOptions , commandOptions ) ;
757- }
758-
759741 /// <summary>
760742 /// Synchronous version of <see cref="UpdateOneAsync(Filter{T}, UpdateBuilder{T})"/>
761743 /// </summary>
762744 /// <inheritdoc cref="UpdateOneAsync(Filter{T}, UpdateBuilder{T})"/>
763- public UpdateResult UpdateOne ( Filter < T > filter , UpdateBuilder < T > update )
764- {
765- return UpdateOne ( filter , update , new UpdateOneOptions < T > ( ) , null ) ;
766- }
767-
768- /// <summary>
769- /// Synchronous version of <see cref="UpdateOneAsync(Filter{T}, UpdateBuilder{T}, UpdateOneOptions{T})"/>
770- /// </summary>
771- /// <inheritdoc cref="UpdateOneAsync(Filter{T}, UpdateBuilder{T}, UpdateOneOptions{T})"/>
772- public UpdateResult UpdateOne ( Filter < T > filter , UpdateBuilder < T > update , UpdateOneOptions < T > updateOptions )
745+ public void UpdateOne ( Filter < T > filter , UpdateBuilder < T > update )
773746 {
774- return UpdateOne ( filter , update , updateOptions , null ) ;
747+ UpdateOne ( filter , update , null ) ;
775748 }
776749
777750 /// <summary>
778- /// Synchronous version of <see cref="UpdateOneAsync(Filter{T}, UpdateBuilder{T}, UpdateOneOptions{T}, CommandOptions)"/>
751+ /// Synchronous version of <see cref="UpdateOneAsync(Filter{T}, UpdateBuilder{T}, CommandOptions)"/>
779752 /// </summary>
780- /// <inheritdoc cref="UpdateOneAsync(Filter{T}, UpdateBuilder{T}, UpdateOneOptions{T}, CommandOptions)"/>
781- public UpdateResult UpdateOne ( Filter < T > filter , UpdateBuilder < T > update , UpdateOneOptions < T > updateOptions , CommandOptions commandOptions )
753+ /// <inheritdoc cref="UpdateOneAsync(Filter{T}, UpdateBuilder{T}, CommandOptions)"/>
754+ public void UpdateOne ( Filter < T > filter , UpdateBuilder < T > update , CommandOptions commandOptions )
782755 {
783- var response = UpdateOneAsync ( filter , update , updateOptions , commandOptions , true ) . ResultSync ( ) ;
784- return response ;
785- }
786-
787- /// <summary>
788- /// Update a single row in the table using the provided update builder and options.
789- ///</summary>
790- /// <param name="update"></param>
791- /// <param name="updateOptions"></param>
792- /// <returns></returns>
793- public Task < UpdateResult > UpdateOneAsync ( UpdateBuilder < T > update , UpdateOneOptions < T > updateOptions )
794- {
795- return UpdateOneAsync ( null , update , updateOptions , null ) ;
796- }
797-
798- /// <inheritdoc cref="UpdateOneAsync(UpdateBuilder{T}, UpdateOneOptions{T})"/>
799- /// <param name="commandOptions"></param>
800- public Task < UpdateResult > UpdateOneAsync ( UpdateBuilder < T > update , UpdateOneOptions < T > updateOptions , CommandOptions commandOptions )
801- {
802- return UpdateOneAsync ( null , update , updateOptions , commandOptions ) ;
756+ UpdateOneAsync ( filter , update , commandOptions , true ) . ResultSync ( ) ;
803757 }
804758
805759 /// <summary>
806760 /// Update a single row in the table using the provided filter and update builder.
807761 ///
808- /// This is similar to <see cref="FindOneAndUpdateAsync(Filter{T}, UpdateBuilder{T})"/> but does not return the updated document.
809762 /// </summary>
810763 /// <param name="filter"></param>
811764 /// <param name="update"></param>
812765 /// <returns></returns>
813- public Task < UpdateResult > UpdateOneAsync ( Filter < T > filter , UpdateBuilder < T > update )
766+ public Task UpdateOneAsync ( Filter < T > filter , UpdateBuilder < T > update )
814767 {
815- return UpdateOneAsync ( filter , update , null , null ) ;
768+ return UpdateOneAsync ( filter , update , null ) ;
816769 }
817770
818771 /// <inheritdoc cref="UpdateOneAsync(Filter{T}, UpdateBuilder{T})"/>
819- /// <param name="updateOptions"></param>
820- public Task < UpdateResult > UpdateOneAsync ( Filter < T > filter , UpdateBuilder < T > update , UpdateOneOptions < T > updateOptions )
821- {
822- return UpdateOneAsync ( filter , update , updateOptions , null ) ;
823- }
824-
825- /// <inheritdoc cref="UpdateOneAsync(Filter{T}, UpdateBuilder{T}, UpdateOneOptions{T})"/>
826772 /// <param name="commandOptions"></param>
827- public Task < UpdateResult > UpdateOneAsync ( Filter < T > filter , UpdateBuilder < T > update , UpdateOneOptions < T > updateOptions , CommandOptions commandOptions )
773+ public Task UpdateOneAsync ( Filter < T > filter , UpdateBuilder < T > update , CommandOptions commandOptions )
828774 {
829- return UpdateOneAsync ( filter , update , updateOptions , commandOptions , false ) ;
775+ return UpdateOneAsync ( filter , update , commandOptions , false ) ;
830776 }
831777
832- internal async Task < UpdateResult > UpdateOneAsync ( Filter < T > filter , UpdateBuilder < T > update , UpdateOneOptions < T > updateOptions , CommandOptions commandOptions , bool runSynchronously )
778+ internal async Task UpdateOneAsync ( Filter < T > filter , UpdateBuilder < T > update , CommandOptions commandOptions , bool runSynchronously )
833779 {
834- updateOptions = updateOptions ?? new UpdateOneOptions < T > ( ) ;
835- updateOptions . Filter = filter ;
836- updateOptions . Update = update ;
780+ var updateOptions = new UpdateOneOptions < T >
781+ {
782+ Filter = filter ,
783+ Update = update
784+ } ;
837785 var command = CreateCommand ( "updateOne" ) . WithPayload ( updateOptions ) . AddCommandOptions ( commandOptions ) ;
838- var response = await command . RunAsyncReturnStatus < UpdateResult > ( runSynchronously ) . ConfigureAwait ( false ) ;
839- return response . Result ;
786+ await command . RunAsyncReturnStatus < UpdateResult > ( runSynchronously ) . ConfigureAwait ( false ) ;
840787 }
841788
842789 /// <summary>
@@ -944,6 +891,7 @@ public Task<DeleteResult> DeleteOneAsync(Filter<T> filter, TableDeleteOptions<T>
944891
945892 internal async Task < DeleteResult > DeleteOneAsync ( Filter < T > filter , TableDeleteOptions < T > deleteOptions , CommandOptions commandOptions , bool runSynchronously )
946893 {
894+ deleteOptions ??= new TableDeleteOptions < T > ( ) ;
947895 deleteOptions . Filter = filter ;
948896 var command = CreateCommand ( "deleteOne" ) . WithPayload ( deleteOptions ) . AddCommandOptions ( commandOptions ) ;
949897 var response = await command . RunAsyncReturnStatus < DeleteResult > ( runSynchronously ) . ConfigureAwait ( false ) ;
0 commit comments