Returns the hash code for this instance. Preserve() Gets aValueTask<TResult>that may be used at any point in the future. ToString() Returns a string that represents the current object. Operators Equality(ValueTask<TResult>, ValueTask<TResult>) ...
デリゲートにバインドされていない Task<TResult> のプロデューサー側を表し、Task プロパティを介してコンシューマー側にアクセスできるようにします。
このトピックの一部は機械翻訳または AI 翻訳されている場合があります。 アラートを無視 バージョン .NET 9 検索する System.Threading.Tasks ConcurrentExclusiveSchedulerPair ConfigureAwaitOptions 並列 ParallelLoopResult ParallelLoopState ParallelOptions ...
This method creates aTask<TResult>object whoseTask<TResult>.Resultproperty isresultand whoseStatusproperty isRanToCompletion. The method is commonly used when the return value of a task is immediately known without executing a longer code path. The example provides an illustration. ...
This method creates aTask<TResult>object whoseTask<TResult>.Resultproperty isresultand whoseStatusproperty isRanToCompletion. The method is commonly used when the return value of a task is immediately known without executing a longer code path. The example provides an illustration. ...
Overloads of their StartNew method let you pass arguments, define task creation options, and specify a task scheduler. The following example uses the TaskFactory<TResult>.StartNew(Func<TResult>) method to start a task. It is functionally equivalent to the code in the previous example....
Task<TResult> 類別代表傳回值且通常會以異步方式執行的單一作業。 Task<TResult> 對像是 工作架構異步模式的其中一個中央元件, 首先在 .NET Framework 4 中引進。 由於 Task<TResult> 物件所執行的工作通常會以異步方式在線程集區線程上執行,而不是在主要應用程式線程上同步執行,因此您可以使用 Status 屬性,...
Task<TResult>类表示返回值且通常以异步方式执行的单个操作。Task<TResult>对象是基于任务的异步模式的核心组件之一,首先在 .NET Framework 4 中引入。 由于Task<TResult>对象执行的工作通常以异步方式在线程池线程上执行,而不是在主应用程序线程上同步执行,因此可以使用Status属性以及IsCanceled、IsCompleted和IsFaulted...
{this.resolver = A.Fake<IRouteResolver>();this.response =newResponse();this.route =newFakeRoute(response);this.context =newNancyContext();this.statusCodeHandler = A.Fake<IStatusCodeHandler>();this.requestDispatcher = A.Fake<IRequestDispatcher>();this.diagnosticsConfiguration =newDiagnosticsConfigu...
There's another more minor difference: if the task completes in a faulted state (i.e., with an exception), then await will (re-)raise that exception as-is, but Result will wrap the exception in an AggregateException. As a side note, avoid Task.Factory.StartNew. It's almost never the...