Valid 70-483 Dumps shared by ExamDiscuss.com for Helping Passing 70-483 Exam! ExamDiscuss.com now offer the newest 70-483 exam dumps, the ExamDiscuss.com 70-483 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com 70-483 dumps with Test Engine here:
You are implementing a method named ProcessReports that performs a long-running task. The ProcessReports() method has the following method signature: public void ProcessReports(List<decimal> values,CancellationTokenSource cts, CancellationToken ct) If the calling code requests cancellation, the method must perform the following actions: * Cancel the long-running task. * Set the task status to TaskStatus.Canceled. You need to ensure that the ProcessReports() method performs the required actions. Which code segment should you use in the method body?
Correct Answer: B
Explanation: The CancellationToken.ThrowIfCancellationRequested method throws a OperationCanceledException if this token has had cancellation requested. This method provides functionality equivalent to: C# if (token.IsCancellationRequested) throw new OperationCanceledException(token); Reference: CancellationToken.ThrowIfCancellationRequested Method () https://msdn.microsoft.com/en- us/library/system.threading.cancellationtoken.throwifcancellationrequested(v=vs.110).aspx