exam questions

Exam 70-486 All Questions

View all questions & answers for the 70-486 exam

Exam 70-486 topic 1 question 167 discussion

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

DRAG DROP -
You are developing an ASP.NET Core application. You plan to use YAML as the configuration language. You create a custom YAML configuration parser.
You need to implement a mechanism to support reading and applying these YAML configurations.
How should you complete the code? To answer, drag the appropriate code segments to the correct locations. 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.
NOTE: Each correct selection is worth one point.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Reference:
https://andrewlock.net/creating-a-custom-iconfigurationprovider-in-asp-net-core-to-parse-yaml/

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
Snowpl
Highly Voted 5 years, 11 months ago
This answer is wrong it should be swapped. the source should inherit from : FileConfigurationSource the provider should inherit from: FileConfigurationProvider
upvoted 43 times
...
Piggas
Highly Voted 5 years, 9 months ago
Agree with Snowpl, the source should inherit from : FileConfigurationSource the provider should inherit from: FileConfigurationProvider
upvoted 9 times
...
Leodolz
Most Recent 4 years, 5 months ago
Also, to support Snowpl's answer, if you carefully see the code inside, the Yaml Configuration provider constructor requires a Yaml Configuration Source, and as we see on the override to the Build method, it passes "this" as a parameter, which makes that class necessary to be a FileConfigurationSource instead of FileConfigurationProvider as the solution suggests. So yes, they should be swapped
upvoted 3 times
northgaterebel
4 years, 5 months ago
According to the link provided in the answer they should be swapped: https://andrewlock.net/creating-a-custom-iconfigurationprovider-in-asp-net-core-to-parse-yaml/#the-configurationsource public class YamlConfigurationSource : FileConfigurationSource https://andrewlock.net/creating-a-custom-iconfigurationprovider-in-asp-net-core-to-parse-yaml/#the-configurationprovider public class YamlConfigurationProvider : FileConfigurationProvider
upvoted 2 times
...
...
noussa
4 years, 9 months ago
I agree they should be swapped. See the link: https://andrewlock.net/creating-a-custom-iconfigurationprovider-in-asp-net-core-to-parse-yaml/
upvoted 3 times
...
EltonCostaBR
4 years, 10 months ago
Hilarious!
upvoted 2 times
...
DB1984
4 years, 11 months ago
But see inside the class there is provider related function isn’t it. So is the answer correct?
upvoted 3 times
...
mr_
5 years ago
Agree. Answers are wrong and should be swapped. FileConfigurationSource should implement method Build and FileConfigurationProvider should implement method Load.
upvoted 3 times
...
gemini6609
5 years, 7 months ago
I also agree with Snowpl, if you read the article referenced clearly the code examples exemplify that the source should inherit from FileConfigurationSource and the provider from FileConfigurationProvider.
upvoted 8 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 ...