[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis document outlines the \u003ccode\u003eTaskExtensions\u003c/code\u003e class within the \u003ccode\u003eGoogle.Api.Gax\u003c/code\u003e namespace, providing extension methods for working with tasks.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eResultWithUnwrappedExceptions<T>(Task<T>)\u003c/code\u003e method retrieves the result of a task, unwrapping any \u003ccode\u003eAggregateException\u003c/code\u003e to its first inner exception.\u003c/p\u003e\n"],["\u003cp\u003eMultiple \u003ccode\u003eWaitWithUnwrappedExceptions\u003c/code\u003e methods allow for synchronous waiting on a task's completion, optionally with timeouts or cancellation tokens, while also unwrapping \u003ccode\u003eAggregateException\u003c/code\u003e occurrences.\u003c/p\u003e\n"],["\u003cp\u003eThe methods documented all deal with waiting for tasks to complete, and the proper handling of potential \u003ccode\u003eAggregateExceptions\u003c/code\u003e that can occur.\u003c/p\u003e\n"],["\u003cp\u003eThe documented assembly is Google.Api.Gax.dll and the latest version is 4.10.0.\u003c/p\u003e\n"]]],[],null,["# Class TaskExtensions (4.10.0)\n\nVersion latestkeyboard_arrow_down\n\n- [4.10.0 (latest)](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.TaskExtensions)\n- [4.8.0](/dotnet/docs/reference/Google.Api.Gax/4.8.0/Google.Api.Gax.TaskExtensions)\n- [4.4.0](/dotnet/docs/reference/Google.Api.Gax/4.4.0/Google.Api.Gax.TaskExtensions)\n- [4.3.1](/dotnet/docs/reference/Google.Api.Gax/4.3.1/Google.Api.Gax.TaskExtensions)\n- [4.2.0](/dotnet/docs/reference/Google.Api.Gax/4.2.0/Google.Api.Gax.TaskExtensions)\n- [4.0.0](/dotnet/docs/reference/Google.Api.Gax/4.0.0/Google.Api.Gax.TaskExtensions)\n- [3.2.0](/dotnet/docs/reference/Google.Api.Gax/3.2.0/Google.Api.Gax.TaskExtensions) \n\n public static class TaskExtensions\n\nExtension methods for tasks. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e TaskExtensions \n\nInherited Members\n-----------------\n\n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Api.Gax](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax)\n\nAssembly\n--------\n\nGoogle.Api.Gax.dll\n\nMethods\n-------\n\n### ResultWithUnwrappedExceptions\\\u003cT\\\u003e(Task\\\u003cT\\\u003e)\n\n public static T ResultWithUnwrappedExceptions\u003cT\u003e(this Task\u003cT\u003e task)\n\nSynchronously waits for the given task to complete, and returns the result.\nAny [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) thrown is unwrapped to the first inner exception.\n\n### WaitWithUnwrappedExceptions(Task)\n\n public static void WaitWithUnwrappedExceptions(this Task task)\n\nSynchronously waits for the given task to complete.\nAny [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) thrown is unwrapped to the first inner exception.\n\n### WaitWithUnwrappedExceptions(Task, int)\n\n public static bool WaitWithUnwrappedExceptions(this Task task, int millisecondsTimeout)\n\nSynchronously waits for the given task to complete.\nAny [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) thrown is unwrapped to the first inner exception.\n\n### WaitWithUnwrappedExceptions(Task, int, CancellationToken)\n\n public static bool WaitWithUnwrappedExceptions(this Task task, int millisecondsTimeout, CancellationToken cancellationToken)\n\nSynchronously waits for the given task to complete.\nAny [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) thrown is unwrapped to the first inner exception.\n\n### WaitWithUnwrappedExceptions(Task, CancellationToken)\n\n public static void WaitWithUnwrappedExceptions(this Task task, CancellationToken cancellationToken)\n\nSynchronously waits for the given task to complete.\nAny [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) thrown is unwrapped to the first inner exception.\n\n### WaitWithUnwrappedExceptions(Task, TimeSpan)\n\n public static bool WaitWithUnwrappedExceptions(this Task task, TimeSpan timeout)\n\nSynchronously waits for the given task to complete.\nAny [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception) thrown is unwrapped to the first inner exception."]]