Which method should you use?

###BeginCaseStudy###
Case Study: 1

Scenario 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.
• The GetTop100Books() 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.
• The ImportBooks() method must keep a copy of the data that can be accessed while
new books are being imported without blocking reads.
• The CreateMonthlyTotalsReport() 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 the 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.
• The BookApiController class must have a method that is able to perform ad-hoc
queries using OData.
The RESTful API of the bookstore must expose the following endpoints.

Application Structure

PurchaseOrders.xml

Featured Boo ks.xml

###EndCaseStudy###

You need to implement the Get() method in the bookstore Web API application to be able to
find books by using an ad hoc query.
Which method should you use?

###BeginCaseStudy###
Case Study: 1

Scenario 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.
• The GetTop100Books() 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.
• The ImportBooks() method must keep a copy of the data that can be accessed while
new books are being imported without blocking reads.
• The CreateMonthlyTotalsReport() 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 the 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.
• The BookApiController class must have a method that is able to perform ad-hoc
queries using OData.
The RESTful API of the bookstore must expose the following endpoints.

Application Structure

PurchaseOrders.xml

Featured Boo ks.xml

###EndCaseStudy###

You need to implement the Get() method in the bookstore Web API application to be able to
find books by using an ad hoc query.
Which method should you use?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 6

Your email address will not be published. Required fields are marked *


qaz

qaz

It must be B.
D will throw compile error.
A is already implemented in code(Application Structure).
“The RESTful API of the bookstore must expose the following endpoints
Get list of all book and get book by id”.

Between B and C.
“application to be able to find books by using an ad hoc query.”
http://stackoverflow.com/questions/252785/what-is-the-difference-between-iqueryablet-and-ienumerablet/25664959
According to upper article I thing that right answer is B – IQueryble

FigArt

FigArt

Great explanation and justification. Agree that the answer is B

chicco

chicco

I think the correct answer is B but I need to make more research on it…

Angel

Angel

“application to be able to find books” – you do not find books by calling All method!

FigArt

FigArt

The other choice returns a list of one book