You need to extend the edit functonality of RunLogController. Which code segment should you use?
A. Opton A
B. Opton B
C. Opton C
D. Opton D
You need to implement the map of the runners' paths.
How should you build the video viewer? (To answer, select the appropriate optons in the answer area.)
You need to ensure that the applicaton uses RunLogRoleProvider custom role provider.
How should you modify the web.config file? (To answer, drag the appropriate line of code to the correct locaton or locatons. Each line of code may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
You need to ensure that only valid parameters are passed to the EditLog acton.
How should you build the route? (To answer, drag the appropriate code segments to the correct locaton or locatons.
Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)
You are Creating an application that manages information about ZOO animals. The application includes a class named Animal and a method named Save.
The Save() method must be strongly typed. It must allow only types inherited from the Animal class that uses a constructor that accepts no parameters.
You need to implement the Save() method. Which code segment should you use?
A. Option A B. Option B C. Option C D. Option D Answer: C Explanation:
When you define a generic class, you can apply restrictions to the kinds of types that client Code can use for type arguments when it instantiates your class. If client Code tries to instantiate your class by using a type that is not allowed by a constraint, the result is a compile- time error. These restrictions are called constraints. Constraints are specified by using the where contextual keyword.
You are implementing a method named Calculate that performs Conversions between value types and reference types. The following code segment implements the method. (Line numbers are included for reference only.)
You need to ensure that the application does not throw exceptions on invalid conversions. Which code segment should you insert at line 04?
A. intbalance = (int) (float)amountRef;
B. int balance = (int)amountRef;
C. intbalance = amountRef;
D. intbalance = (int) (double) amountRef; Answer: A
You are Creating a class named Employee. The class exposes a string property named EmployeeType. The following code segment defines the Employee class. (Line numbers are included for reference only.)
The EmployeeType property value must be accessed and modified only by Code within the Employee class or within a class derived from the Employee class.
You need to ensure that the implementation of the EmployeeType property meets the requirements. Which two actions should you perform?(Each correct answer represents part of the complete solution. Choose two.)
A. Replace line 05 with the following code segment: protected get;
B. Replace line 06 with the following code segment: private set;
C. Replace line 03 with the following code segment: public string EmployeeType
D. Replace line 05 with the following code segment: private get;
E. Replace line 03 with the following code segment: protected string EmployeeType F. Replace line 06 with the following code segment: protected set;
Answer: B, E
You use the Task. Run() method to launch a long-running data processing operation. The data processing operation often fails in times of heavy network congestion.
if the data processing operation fails, a second operation must clean up any results of the first operation. You need to ensure that the second operation is invoked only if the data processing operation throws an unhandled exception.
What should you do?
A. Create a TaskCompletionSource&T- object and call the TrySetException() method of the object.
B. Create a task by calling the Task.ContinueWith() method.
C. Examine the Task. Status property immediately after the call to the Task. Run() method.
D. Create a task inside the existing Task. Run() method by using the Attached ToParent option. Answer: B
You are developing an application that uses structured exception handling. The application includes a class named ExceptionLogger..
The ExceptionLogger class implements a method named LogException by using the following Code segment: public static void LogException (Exception ex)
You have the following requirements:
Log all exceptions by using the LogException() method of the ExceptionLogger class. Rethrow the original exception, including the entire exception stack.
You need to meet the requirements. Which code segment should you use?
A. Option A B. Option B C. Option C D. Option D Answer: A
Explanation: Once an exception is thrown, part of the information it carries is the stack trace. The stack trace is a list of the method call hierarchy that starts with the method that throws the exception and ends with the method that catches the exception. If an exception is re-thrown by specifying the exception in the throw statement, the stack trace is restarted at the current method and the list of method calls between the original method that threw the exception and the Current method is lost. To keep the original stack trace information with the exception, use the throw statement without specifying the exception.
You are adding a public method named UpdateScore to a public class named ScoreCard. The code region that updates the score field must meet the following requirements:
It must be accessed by only one thread at a time.
It must not be vulnerable to a deadlock situation. You need to implement the UpdateScore() method. What should you do?
A. Option A
B. Option B
C. Option C
D. Option D