exam questions

Exam 70-486 All Questions

View all questions & answers for the 70-486 exam

Exam 70-486 topic 3 question 16 discussion

Actual exam question from Microsoft's 70-486
Question #: 16
Topic #: 3
[All 70-486 Questions]

You need to ensure that new customers enter a valid email address.
Which code should you use? (Each correct answer presents part of the solution. Choose all that apply.)

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
Show Suggested Answer Hide Answer
Suggested Answer: AD 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Aerologic
Highly Voted 5 years, 6 months ago
I think the Regex const string name for A is incorrect, should be EmailRegex, not emailPattern.
upvoted 12 times
...
zimzimzimma
Highly Voted 5 years ago
The attribute [ComplexType] is only valid on class declarations, not on variable declarations. I suspect emailPattern in A is a typo. I think A and D are correct.
upvoted 6 times
...
luixaca
Most Recent 4 years, 5 months ago
A and D are the correct answers. I can confirm they corrected the "emailPattern" typo in the exam.
upvoted 3 times
...
Dev666
5 years, 1 month ago
B D As is EmailRegex
upvoted 1 times
Dev666
5 years, 1 month ago
actually B is wrong also as ErrorMessageResourceType expects a type not an enum
upvoted 2 times
Dev666
5 years, 1 month ago
So the only answer is D ....
upvoted 3 times
ozner16
4 years, 8 months ago
yes, you are right, its only D. Surely its not 'A' because 'emailPattern' string does not exist within the context, then I tried to declare option B in VS but I couldnt because it throws the next message: "Cannot implicitly convert type 'System.ComponentModel.DataAnnotations.DataType' to 'System.Type". You all can try this by creating an asp net core project in VS and trying to compile the next piece of code: public class mapache { [RegularExpression("", ErrorMessageResourceType = DataType.EmailAddress)] public string cola { get; set; } }
upvoted 2 times
...
...
...
...
AT_TW
5 years, 4 months ago
What is Correct Answer ?
upvoted 1 times
...
Dhaval
5 years, 4 months ago
Correct Answer is only B. D is invalid since the Model decorator is [DataType] is missing.
upvoted 4 times
...
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.

SaveCancel
Loading ...