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 itmatches 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 B: controller.GetType().Attributes will not return custom attributes. References: https://msdn.microsoft.com/en-us/library/system.reflection.memberinfo.customattributes(v=vs.110).aspx
None is correct. C would by if there was == false not == null in the check. And as far as I know this examples, there is typo there and on the exam the check is correct.
GetType().CustomAttributes does not exist (MemberInfo.GetCustomAttributes() does exist, but that is not returned by GetType()), and Any() returns a bool, not a collection (or null). C is bogus, B is the correct answer.
Disagree. Type is inherited from MemberInfo and it has CustomAttributes. B can't be correct because it uses Attributes. Attributes property has type TypeAttributes that is enum.
But I agree that Any returns bool and can't return null.
Is C https://msdn.microsoft.com/en-us/library/system.reflection.memberinfo.customattributes(v=vs.110).aspx
upvoted 3 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, 11 months agodesona
5 years, 2 months agoEd64
5 years, 7 months agoalex_ozr
5 years, 7 months agodrizet
5 years, 6 months agoDev666
5 years, 2 months ago