exam questions

Exam 70-486 All Questions

View all questions & answers for the 70-486 exam

Exam 70-486 topic 1 question 54 discussion

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

DRAG DROP -
You are developing an ASP.NET MVC application in Visual Studio 2012. The application processes data for a bakery and contains a controller named
BagelController.cs that has several actions. The GetBagel action is defined in the following code segment.

The GetBagel action is the only action that should be accessed via a URL pattern. Routes to the other actions in the controller must be suppressed.
The default route must map to HomeController and the Index action.
You need to build the routes.
Which three code segments should you use in sequence? (To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.)
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:

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
ex
Highly Voted 5 years, 6 months ago
Answer is correct. It's working from the most targeted to the most general. So specific method goes first, then Ignore for a specific controller, then Default.
upvoted 18 times
...
hungry_ape9000
Most Recent 5 years, 1 month ago
FINAL ANSWER: routes.MapRoute(name: "Bagels", url: "Bagel/GetBagel/{bagelName}", defaults: new { controller = "Bagel", action = "GetBagel" }); routes.IgnoreRoute("Bagel/{*pathInfo}"); routes.MapRoute("Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional });
upvoted 4 times
...
cristopherpereiramoreira
5 years, 9 months ago
Actually most of the examples shows IgnoreRoute as the first statement
upvoted 1 times
...
Snowpl
5 years, 10 months ago
order is wrong ignore should be on bottom
upvoted 2 times
Abou_riyad
4 years, 8 months ago
If we add ignore at the bottom, it will not ignore the actions in Bagel controller, because they are already allowed in the rule before.
upvoted 2 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 ...