Which code segment should you use?

Posted by: Pdfprep Category: 70-486 Tags: , ,

You need to modify the application to meet the productId requirement.

Which code segment should you use?

A . Option A
B . Option B
C . Option C
D . Option D

Answer: C

Explanation:

Scenario: The value of the productId property must always be greater than 0.

Note: The Contract.Requires(Of TException) method specifies a precondition contract for the enclosing method or property, and throws an exception if the condition for the contract fails.

Syntax:

‘Declaration

Public Shared Sub Requires(Of TException As Exception) ( _ condition As Boolean _)

Type Parameters

TException

The exception to throw if the condition is false.

Parameters

condition

Type: System.Boolean

The conditional expression to test.

Reference: Contract.Requires(Of TException) Method (Boolean)

Leave a Reply

Your email address will not be published.