PrepAway - Latest Free Exam Questions & Answers

Which code segments should you include in Target 1 and …

###BeginCaseStudy###
Testlet 1
Background
You are developing an online bookstore web application that will be used by your company’s customers.
Technical Requirements
General requirements:
The web store application must be an ASP.NET MVC application written in Visual Studio.
The application must connect to a Microsoft SQL database.
TheGetTop100Books()method is mission critical and must return data as quickly as possible. It should take
advantage of fast, forward-only, read-only methods of reading data.
TheImportBooks()method must keep a copy of the data that can be accessed while new books are being
imported without blocking reads.
TheCreateMonthlyTotalsReport()method must lock the data and prevent others from updating or inserting
new rows until complete.
The college textbook area of the web application must get data from a daily updated CSV file.
The children’s book area of the web application must get data directly from a local database. It must use a
connection string. It must also support access to the stored procedures on a database. Further, it is required
to have strongly typed objects. Finally, it will require access to databases from multiple vendors and needs
to support more than one-to-one mapping of database tables.
The cookbook functionality is contained within a client-side application that must connect to the server using
HTTP and requires access to the data using JavaScript.
TheBookApiControllerclass must have a method that is able to perform ad-hoc queries using OData.
The RESTful API of the bookstore must expose the following endpoint.
Action: Get a list of all books
HTTP method: GET
Relative URI: /books
Action: Get a book by id
HTTP method: GET
Relative URI: /books/id
Action: Create a new book
HTTP method: POST
Relative URI: /books
Action: Update a book
HTTP method: PUT
Relative URI: /books/id
Action: Delete a book
HTTP method: DELETE
Relative URI: /books/id

Application Structure

Main

PurchaseOrders.xml

FeaturedBooks.xml

###EndCaseStudy###

DRAG DROP
You need to configure the server to self-host the bookstore’s Web API application.
You have the following code:

Which code segments should you include in Target 1 and Target 2 to complete the code? (To answer, drag the
appropriate code segments to the correct location in the answer area. Each 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.)
Select and Place:

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:
Use server.OpenAsync().Wait() to put the server into a zen state of acceptance of all connections on the
address we specified earlier.
http://notebookheavy.com/2012/03/13/integration-test-asp-net-web-api-with-structuremap/

6 Comments on “Which code segments should you include in Target 1 and …

    1. Bret Verdi says:

      Normally it would be right. But because of the case:

      Action: Get a list of all books
      HTTP method: GET
      Relative URI: /books
      Action: Get a book by id
      HTTP method: GET
      Relative URI: /books/id
      Action: Create a new book
      HTTP method: POST
      Relative URI: /books
      Action: Update a book
      HTTP method: PUT
      Relative URI: /books/id
      Action: Delete a book
      HTTP method: DELETE
      Relative URI: /books/id

      The answer should be without “api/”




      2



      1
  1. Pascal says:

    Its correct, the answer is correct, we are dealing with api here, bookapi,defaultsapi, it should be api/controllers, the relative URL are just endpoints, of course you dont expect them to include the api path




    3



    1
  2. Pascal says:

    Every api by convention must have an entry point , note that you have an MVC application which has its own route, to differentiate its best practice to include the API




    0



    0

Leave a Reply