MCSD Developing Windows Azure and Web Services v1.0

Page:    1 / 15   
Exam contains 219 questions

Background -
You are developing an ASP.NET MVC application in Visual Studio that will be used to process orders.

Business Requirements -
The application contains the following three pages.
A page that queries an external database for orders that are ready to be processed. The user can then process the order.
A page to view processed orders.
A page to view vendor information.
The application consumes three WCF services to retrieve external data.

Technical Requirements -
Visual Studio Solution:
The solution contains the following four projects.
ExternalQueue: A WCF service project used to communicate with the external order database.
OrderProcessor: An ASP.NET MVC project used for order processing and logging order metadata.
OrderUpload: A WCF service project used to submit order data to an external data source.
Shipping: A WCF service project used to acquire shipping information.
ExternalQueue Project:
Entity Framework is used for data access. The entities are defined in the ExternalOrders.edmx file as shown in the following diagram.


The project contains two services defined in the following files.
IExternalQueueService.es
ExternalQueueService.svc.
The ExternalQueue.Helpers namespace contains a definition for a class named OrderNotFound Exception.
OrderProcessor Project:
Entity Framework is used for data access. The entities are defined in the ProcessedOrders.edmx file as shown in the following diagram.

The classes are contained in the OrderProcessor.Entities namespace. The project contains the following two controllers.
InboundQueueController.es
ProcessedOrderController.es
WCF service proxies to the ExternalQueue, Shipping and OrderUpload services have been generated by using the command prompt. The
ExecuteCommandProcedure() method in the ExternalQueueService.svc file must run asynchronously.
The ProcessedOrderController controller has the following requirements.
The GetVendorPolicy() method must enforce a 10 minute absolute cache expiration policy.
The GetProcessedOrders() method must return a view of the 10 most recently processed orders.
OrderUpload Project:
The project contains two services defined in the following files.
IUploadCallbackService.es

UploadCallbackService.svc -

Data Access is maintained in a file named UploadOrder.es.
Shipping Project:
Entity Framework is used for data access. The entities are defined in the ExternalOrders.edmx file as shown in the following diagram.

The Custom Tool property for ExternalOrders.edmx has been removed.
POCO classes for the Entity Model are located in the ShippingAddress.es file. The POCO entity must be loaded by using lazy loading.
The project contains two services defined in the following files.
IShippingService.es
ShippingService.svc.
The IShippingService contract must contain an operation that receives an order number as a parameter. The operation must return a class named ShippingInfo that inherits from a class named State.

Application Structure -









DRAG DROP -
The GetVendorPolicy() private method in the ProcessedOrderController controller is returning a CacheItemPolicy object with default values. The returned policy must expire if the external file located at C:\Triggers\VendorTrigger.txt has been modified or the timeout outlined in the technical requirements is reached.
You need to return the policy.
You have the following code:

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



Answer :

Explanation:
Example code:
CacheItemPolicy policy = new CacheItemPolicy();
policy.AbsoluteExpiration = DateTimeOffset.Now.AddSeconds(60.0); policy.ChangeMonitors.Add(newHostFileChangeMonitor(filePaths));
References:
https://msdn.microsoft.com/en-us/library/system.runtime.caching.cacheitempolicy(v=vs.110)

Background -
You are developing an ASP.NET MVC application in Visual Studio that will be used to process orders.

Business Requirements -
The application contains the following three pages.
A page that queries an external database for orders that are ready to be processed. The user can then process the order.
A page to view processed orders.
A page to view vendor information.
The application consumes three WCF services to retrieve external data.

Technical Requirements -
Visual Studio Solution:
The solution contains the following four projects.
ExternalQueue: A WCF service project used to communicate with the external order database.
OrderProcessor: An ASP.NET MVC project used for order processing and logging order metadata.
OrderUpload: A WCF service project used to submit order data to an external data source.
Shipping: A WCF service project used to acquire shipping information.
ExternalQueue Project:
Entity Framework is used for data access. The entities are defined in the ExternalOrders.edmx file as shown in the following diagram.


The project contains two services defined in the following files.
IExternalQueueService.es
ExternalQueueService.svc.
The ExternalQueue.Helpers namespace contains a definition for a class named OrderNotFound Exception.
OrderProcessor Project:
Entity Framework is used for data access. The entities are defined in the ProcessedOrders.edmx file as shown in the following diagram.

The classes are contained in the OrderProcessor.Entities namespace. The project contains the following two controllers.
InboundQueueController.es
ProcessedOrderController.es
WCF service proxies to the ExternalQueue, Shipping and OrderUpload services have been generated by using the command prompt. The
ExecuteCommandProcedure() method in the ExternalQueueService.svc file must run asynchronously.
The ProcessedOrderController controller has the following requirements.
The GetVendorPolicy() method must enforce a 10 minute absolute cache expiration policy.
The GetProcessedOrders() method must return a view of the 10 most recently processed orders.
OrderUpload Project:
The project contains two services defined in the following files.
IUploadCallbackService.es

UploadCallbackService.svc -

Data Access is maintained in a file named UploadOrder.es.
Shipping Project:
Entity Framework is used for data access. The entities are defined in the ExternalOrders.edmx file as shown in the following diagram.

The Custom Tool property for ExternalOrders.edmx has been removed.
POCO classes for the Entity Model are located in the ShippingAddress.es file. The POCO entity must be loaded by using lazy loading.
The project contains two services defined in the following files.
IShippingService.es
ShippingService.svc.
The IShippingService contract must contain an operation that receives an order number as a parameter. The operation must return a class named ShippingInfo that inherits from a class named State.

Application Structure -









DRAG DROP -
The GetExternalOrders() method must use members of the EntityClient namespace to query the database for all records in the InboundQueue entity.
You need to modify the GetExternalOrders() method to return the correct data.
You have the following code:

New EntityConnection EntityDataReader CommandBehavior
Which code segments should you include in Target1, Target2, Target3 and Target4 to complete the code? To answer, drag the appropriate code segments to the correct targets in the answer area. 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:



Answer :

Explanation:
Box 1, Box 2: ExternalOrdersEtnities
The GetExternalOrders() method must use members of the EntityClient namespace to query the database for all records in the InboundQueue entity.

Box 3: ExecuteReader -

Box 4: SequentialAccess -

Background -
You are developing an ASP.NET MVC application in Visual Studio that will be used to process orders.

Business Requirements -
The application contains the following three pages.
A page that queries an external database for orders that are ready to be processed. The user can then process the order.
A page to view processed orders.
A page to view vendor information.
The application consumes three WCF services to retrieve external data.

Technical Requirements -
Visual Studio Solution:
The solution contains the following four projects.
ExternalQueue: A WCF service project used to communicate with the external order database.
OrderProcessor: An ASP.NET MVC project used for order processing and logging order metadata.
OrderUpload: A WCF service project used to submit order data to an external data source.
Shipping: A WCF service project used to acquire shipping information.
ExternalQueue Project:
Entity Framework is used for data access. The entities are defined in the ExternalOrders.edmx file as shown in the following diagram.


The project contains two services defined in the following files.
IExternalQueueService.es
ExternalQueueService.svc.
The ExternalQueue.Helpers namespace contains a definition for a class named OrderNotFound Exception.
OrderProcessor Project:
Entity Framework is used for data access. The entities are defined in the ProcessedOrders.edmx file as shown in the following diagram.

The classes are contained in the OrderProcessor.Entities namespace. The project contains the following two controllers.
InboundQueueController.es
ProcessedOrderController.es
WCF service proxies to the ExternalQueue, Shipping and OrderUpload services have been generated by using the command prompt. The
ExecuteCommandProcedure() method in the ExternalQueueService.svc file must run asynchronously.
The ProcessedOrderController controller has the following requirements.
The GetVendorPolicy() method must enforce a 10 minute absolute cache expiration policy.
The GetProcessedOrders() method must return a view of the 10 most recently processed orders.
OrderUpload Project:
The project contains two services defined in the following files.
IUploadCallbackService.es

UploadCallbackService.svc -

Data Access is maintained in a file named UploadOrder.es.
Shipping Project:
Entity Framework is used for data access. The entities are defined in the ExternalOrders.edmx file as shown in the following diagram.

The Custom Tool property for ExternalOrders.edmx has been removed.
POCO classes for the Entity Model are located in the ShippingAddress.es file. The POCO entity must be loaded by using lazy loading.
The project contains two services defined in the following files.
IShippingService.es
ShippingService.svc.
The IShippingService contract must contain an operation that receives an order number as a parameter. The operation must return a class named ShippingInfo that inherits from a class named State.

Application Structure -









DRAG DROP -
You need to modify the ExecuteCommandProcedure() method to meet the technical requirements.
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.)
NOTE: Each correct selection is worth one point.
Select and Place:



Answer :

Explanation:
Synchronous to Asynchronous Connection Open
You can upgrade an existing application to use the new asynchronous feature. For example, assume an application has a synchronous connection algorithm and blocks the UI thread every time it connects to the database and, once connected, the application calls a stored procedure that signals other users of the one who just signed in.
When converted to use the new asynchronous functionality, the program would look like: await conn.OpenAsync(); await cmd.ExecuteNonQueryAsync();
References:
https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/asynchronous-programming

Background -
You are developing an ASP.NET MVC application in Visual Studio that will be used to process orders.

Business Requirements -
The application contains the following three pages.
A page that queries an external database for orders that are ready to be processed. The user can then process the order.
A page to view processed orders.
A page to view vendor information.
The application consumes three WCF services to retrieve external data.

Technical Requirements -
Visual Studio Solution:
The solution contains the following four projects.
ExternalQueue: A WCF service project used to communicate with the external order database.
OrderProcessor: An ASP.NET MVC project used for order processing and logging order metadata.
OrderUpload: A WCF service project used to submit order data to an external data source.
Shipping: A WCF service project used to acquire shipping information.
ExternalQueue Project:
Entity Framework is used for data access. The entities are defined in the ExternalOrders.edmx file as shown in the following diagram.


The project contains two services defined in the following files.
IExternalQueueService.es
ExternalQueueService.svc.
The ExternalQueue.Helpers namespace contains a definition for a class named OrderNotFound Exception.
OrderProcessor Project:
Entity Framework is used for data access. The entities are defined in the ProcessedOrders.edmx file as shown in the following diagram.

The classes are contained in the OrderProcessor.Entities namespace. The project contains the following two controllers.
InboundQueueController.es
ProcessedOrderController.es
WCF service proxies to the ExternalQueue, Shipping and OrderUpload services have been generated by using the command prompt. The
ExecuteCommandProcedure() method in the ExternalQueueService.svc file must run asynchronously.
The ProcessedOrderController controller has the following requirements.
The GetVendorPolicy() method must enforce a 10 minute absolute cache expiration policy.
The GetProcessedOrders() method must return a view of the 10 most recently processed orders.
OrderUpload Project:
The project contains two services defined in the following files.
IUploadCallbackService.es

UploadCallbackService.svc -

Data Access is maintained in a file named UploadOrder.es.
Shipping Project:
Entity Framework is used for data access. The entities are defined in the ExternalOrders.edmx file as shown in the following diagram.

The Custom Tool property for ExternalOrders.edmx has been removed.
POCO classes for the Entity Model are located in the ShippingAddress.es file. The POCO entity must be loaded by using lazy loading.
The project contains two services defined in the following files.
IShippingService.es
ShippingService.svc.
The IShippingService contract must contain an operation that receives an order number as a parameter. The operation must return a class named ShippingInfo that inherits from a class named State.

Application Structure -









DRAG DROP -
You need to create the ShippingContext class in the ShippingAddress.cs file to meet the requirements.
You have the following code:

Which code segments should you include in Target1, Target2, Target3 and Target4 to complete the code? To answer, drag the appropriate code segments to the correct targets in the answer area. 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:



Answer :

Reference:
https://www.dotnetcurry.com/entityframework/725/plain-old-clr-objects-poco-entity-framework
Online Bookstore Web Application

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 -



DRAG DROP -
You need to update the GetBook() method to retrieve book data by using ADO.NET.
You have the following code:

Which code segments should you include in Target 1, Target 2, Target 3, Target 4 and Target 5 to complete this 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:



Answer :

Target 1: conn.Open();
Target 2: "SELECT id, name FROM books WHERE id =@id";
Example of how to use named parameters in CommandType.Text.
SELECT * FROM dbo.Customers WHERE CustomerID =@CustomerID
Target 3:cmd.Parameters.AddWithValue("@id", id);
Examples of AddWithValue usage:
cmdSQL.Parameters.AddWithValue("@CustomerID", CustomerID)
cmdSQL.Parameters.AddWithValue("@CartType", cartType)
Target 4: Id=readerGetGuid(Reader.GetOrdinal("id")),
Target 5: reader.GetString(Reader.GetOrdinal("name"))
Example of usage of GetOrdinal. Call GetOrdinal and assign value to variable. int customerID = reader.GetOrdinal("CustomerID");
References:
https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.createcommand(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtext(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.getordinal(v=vs.110).aspx

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 -


The PurchaseOrders.xml file contains all of the purchase orders for the day.
You need to query the XML file for all of the billing addresses.
Which code segment should you use?
A)

B)

C)

D)

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D


Answer : C

Explanation:
The root element attribute should be Address as per the following line:
From el in root.Elements(aw +"Address")
The Type should be Billing (not Shipping) as per the following line:
Where (string)e1.Attribute(aw + "Type") == "Billing"

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 -



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:



Answer :

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

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 -


You need to return the list of the top 100 books for the GetTopBooks() method.
Which type should you use to retrieve the data?

  • A. DataTable
  • B. SqlDataReader
  • C. DataView
  • D. DataSet


Answer : B

Explanation:
From scenario: 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.
A SqlDataReader is a type that is good for reading data in the most efficient manner possible.
References:
http://csharp-station.com/Tutorial/AdoDotNet/Lesson04

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 -


You are preparing to write the data access code for the children"™s book area of the web site.
You need to review the requirements and identify the appropriate data access technology.
What should you do?

  • A. Use LINQ to SQL
  • B. Use the WCF Data Services.
  • C. Use a Web Service.
  • D. Use ADO.NET Entity Framework.


Answer : D

Using the Entity Framework, developers issue queries using LINQ, then retrieve and manipulate data as strongly typed objects.
From scenario: 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.
References:
http://www.entityframeworktutorial.net/what-is-entityframework.aspx

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 -


You need to create an OData query expression to return the ten books with the largest number of sales.
Which query expression should you use?

  • A. /books?orderby=sales desc&$count=10
  • B. /search?orderby=sales asc&$count=10
  • C. /search?orderby=sales asc&$top=10
  • D. /books?orderby=sales desc&$top=10


Answer : D

Explanation:
$top determines the maximum number of records to return.
From scenario:

Action: Get a list of all books -

HTTP method: GET -

Relative URI: /books -
References:
https://msdn.microsoft.com/en-us/library/gg309461(v=crm.7).aspx

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 -


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.

B.

C.

D.



Answer : B

Explanation:
Compare to the Delete method from the scenario:


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 -


You need to update the CreateMonthlyTotalsReports() method to use database transactions.
Which code segment should you use?

  • A. SqlConnection.BeginTransaction(IsolationLevel.ReadUncommited);
  • B. SqlConnection.BeginTransaction(IsolationLevel.Serializable);
  • C. SqlConnection.BeginTransaction(IsolationLevel.Chaos);
  • D. SqlConnection.BeginTransaction(IsolationLevel.ReadCommitted)


Answer : B

Explanation:
Scenario: The CreateMonthlyTotalsReport() method must lock the data and prevent others from updating or inserting new rows until complete.
The highest isolation level, Serializable, provides a high degree of protection against interruptive transactions, but requires that each transaction complete before any other transactions are allowed to operate on the data.
With Serializable volatile data can be read but not modified, and no new data can be added during the transaction.
References:
https://docs.microsoft.com/en-us/sql/t-sql/statements/set-transaction-isolation-level-transact-sql?view=sql-server-ver15

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 -


You need to create an OData query expression to return the ten books with the smallest number of sales.
Which query expression should you use?

  • A. /books?orderby=sales desc&$count=10
  • B. /search?orderby=sales asc&$count=10
  • C. /search?orderby=sales desc&$top=10
  • D. /books?orderby=sales asc&$top=10


Answer : D

Explanation:
The get the smallest number of sales we should use ascending (asc) ordering.
From scenario: RESTful API endpoints include:

Action: Get a list of all books -

HTTP method: GET -

Relative URI: /books -

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 -


You need to choose the appropriate data access technology for the children"™s book area of the web application.
Which data access technology should you choose?

  • A. Entity Framework
  • B. WCF Data Services
  • C. LINQ to SQL
  • D. Web Service


Answer : A

Explanation:
Scenario: 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.

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 -


You need to create an OData filter expression that returns bools that match the following characteristics:
✑ Published after 1/1/2000
✑ Have "Science" as the first word
Which filter statement should you use?

  • A. /books?$filter=PublishDate gt datetime"™2000-1-1"™ and startswith(Title, "˜Science"™)
  • B. /books?$filter=PublishDate greaterthan datetime"™2000-1-1"™ and startswith(Title, "˜Science"™)
  • C. /search?$filter=PublishDate greaterthan datetime"™2000-1-1"™ and beginswith (Title, "˜Science"™)
  • D. /search?$filter=PublishDate gt datetime"™2000-1-1"™ and beginswith(Title, "˜Science"™)


Answer : A

Explanation:
The gt keyword is used for the greater than comparison.
The startswith keyword is used to compare the beginning of a string.
Example: Returns entry numbers611 and higher.
filter= Entry_No gt 610
Example: Returns all customers names beginning with "S".
filter=startswith(Name, 'S')
References:
https://msdn.microsoft.com/en-us/library/hh169248(v=nav.90).aspx

Adventure Works Cycles -

Page:    1 / 15   
Exam contains 219 questions

Talk to us!


Have any questions or issues ? Please dont hesitate to contact us

Certlibrary.com is owned by MBS Tech Limited: Room 1905 Nam Wo Hong Building, 148 Wing Lok Street, Sheung Wan, Hong Kong. Company registration number: 2310926
Certlibrary doesn't offer Real Microsoft Exam Questions. Certlibrary Materials do not contain actual questions and answers from Cisco's Certification Exams.
CFA Institute does not endorse, promote or warrant the accuracy or quality of Certlibrary. CFA® and Chartered Financial Analyst® are registered trademarks owned by CFA Institute.
Terms & Conditions | Privacy Policy