@@ -102,10 +102,11 @@ public static Task<IDocument> WhenStable(this Task<IDocument> documentTask) =>
102102 /// <param name="documentTask">The document task to await.</param>
103103 /// <param name="cancellation">The timeout cancellation, if any.</param>
104104 /// <returns>A task that is finished when the document is available.</returns>
105- public static async Task WaitUntilAvailable ( this Task < IDocument > documentTask , CancellationToken cancellation = default )
105+ public static async Task < IDocument > WaitUntilAvailable ( this Task < IDocument > documentTask , CancellationToken cancellation = default )
106106 {
107107 var document = await documentTask . ConfigureAwait ( false ) ;
108108 await document . WaitUntilAvailable ( cancellation ) . ConfigureAwait ( false ) ;
109+ return document ;
109110 }
110111
111112 /// <summary>
@@ -116,7 +117,7 @@ public static async Task WaitUntilAvailable(this Task<IDocument> documentTask, C
116117 /// <param name="document">The document to await.</param>
117118 /// <param name="cancellation">The timeout cancellation, if any.</param>
118119 /// <returns>A task that is finished when the document is available.</returns>
119- public static async Task WaitUntilAvailable ( this IDocument document , CancellationToken cancellation = default )
120+ public static async Task < IDocument > WaitUntilAvailable ( this IDocument document , CancellationToken cancellation = default )
120121 {
121122 if ( document . ReadyState != DocumentReadyState . Complete )
122123 {
@@ -126,6 +127,7 @@ public static async Task WaitUntilAvailable(this IDocument document, Cancellatio
126127 }
127128
128129 await document . WhenStable ( ) . ConfigureAwait ( false ) ;
130+ return document ;
129131 }
130132 }
131133}
0 commit comments