exam questions

Exam 70-486 All Questions

View all questions & answers for the 70-486 exam

Exam 70-486 topic 1 question 155 discussion

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

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some questions sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You develop an ASP.NET Core MVC web application. You have a legacy business system that sends data to the web application by using Web API. The legacy business system uses proprietary data formats.
You need to handle the proprietary data format.
Solution: Add a custom formatter class to the Web API and implement the IInputFormatter interface.
Does the solution meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️
References:
https://docs.microsoft.com/en-us/aspnet/core/web-api/advanced/custom-formatters?view=aspnetcore-2.1 https://www.c-sharpcorner.com/article/custom-formatters-in-asp-net-core-mvc-web-api/

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
zimzimzimma
Highly Voted 4 years, 11 months ago
"You develop an ASP.NET Core MVC web application. You have a legacy business system that sends data to the web application by using Web API. The legacy business system uses proprietary data formats." The legacy business system sends data TO the webapplication which you're developing, so the webapplication needs consume the INCOMING data. So you need to write an INPUTformatter, because it is INPUT.
upvoted 5 times
...
aousos
Most Recent 5 years, 1 month ago
the answer is no : it says add a custom formatter to the WEB API ===> so it s output formatter if it says : add a formatter to MVC collection the it woud be input formatter. So it s an output for web api and an input for mvc collection . for this question the answer is no
upvoted 3 times
mr_
4 years, 11 months ago
For me there are two apps - legacy & our Web App (WebAPI). Legacy system sends data in proprietary format to our Web App, so for our Web App it is input (request to our API) that we have to deserialize, not output (not response from our Web App). I would go for InputFormatter, so answer is correct IMO.
upvoted 2 times
...
...
Aghie
5 years, 9 months ago
"Create an output formatter class if you want to serialize data to send to the client." So its a No.
upvoted 4 times
Thanh_Nguyen
5 years, 5 months ago
Wrong, accordnig to https://www.c-sharpcorner.com/article/custom-formatters-in-asp-net-core-mvc-web-api/ - Create output formatter (if we require serializing the data to send to the client) - Create input formatter (if we require deserializing the data received from the client)
upvoted 11 times
rhysabray
5 years, 3 months ago
Yeah the given answer is correct, because the data is being received by our application we use the input formatter and and add instances of it to the inputFormatters collection in MvcOptions source --> https://docs.microsoft.com/en-us/aspnet/core/web-api/advanced/custom-formatters?view=aspnetcore-3.1
upvoted 6 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 ...