You need to ensure that all the MVC controllers are secure. Which code segment should you use as the body for the CreateController method in AdminVerifierFactory.cs?
Suggested Answer:C🗳️
The MemberInfo.CustomAttributes property gets a collection that contains this member's custom attributes. The Any() statement will either return null or a collection of matched custom attributes. If it matches one or more, the controller is secure, otherwise an exception is thrown. From scenario: The application contains a header that is visible on every page. If the logged-on user is an administrator, then the header will contain links to administrative functions. This information is read from a cookie that is set on the server. The administrative links must not be present if an error condition is present. Incorrect: Not A: controller.GetType().Attributes will not return custom attributes. References: https://msdn.microsoft.com/en-us/library/system.reflection.memberinfo.customattributes(v=vs.110).aspx
All answers are incorrect. There is probably a typo in answer 3, it either should have false check instead of null, or where instead of any. This two alterations will make it correct.
upvoted 2 times
...
This section is not available anymore. Please use the main Exam Page.70-486 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
elathir
4 years, 9 months ago