Free 70-483 Training Exam Question 5

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?

Options

A.  if (ct.IsCancellationRequested)return;
B.  ct.ThrowIfCancellationRequested() ;
C.  cts.Cancel();
D.  throw new AggregateException();

Correct Answer: B
Show Answer

2 Exams PDF Files

$50 Original Price $ 70

  • Latest and Most Up-todate Dumps
  • Free 3 Months Updates
  • Exam Passing Guarantee
  • Secure Payment
  • Privacy Protection

3 Exams PDF Files

$70 Original Price $ 105

  • Latest and Most Up-todate Dumps
  • Free 3 Months Updates
  • Exam Passing Guarantee
  • Secure Payment
  • Privacy Protection

4 Exams PDF Files

$85 Original Price $ 140

  • Latest and Most Up-todate Dumps
  • Free 3 Months Updates
  • Exam Passing Guarantee
  • Secure Payment
  • Privacy Protection

5 Exams PDF Files

$100 Original Price $ 175

  • Latest and Most Up-todate Dumps
  • Free 3 Months Updates
  • Exam Passing Guarantee
  • Secure Payment
  • Privacy Protection