You need to modify the application to meet the productId requirement.
What should you do?
A . Modify the RegisterGlobalFilters method of the Global.asax.cs file as follows.
Contract.Assume<ArgumentException>(productId != 0);
B . Modify the GetDealPrice method of ProductController as follows.
Contract.Requires<ArgumentException>(productId > 0);
C . Modify the RegisterGlobalFilters method of the Global.asax.cs file as follows. Contract.Requires<ArgumentException>(productId > 0);
D . Modify the GetDealPrice method of ProductController as follows.
Contract.Assume<ArgumentException>(productId > 0);
Answer: B
Explanation:
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)
Latest 70-486 Dumps Valid Version with 255 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund