70-487 Real Exam Dumps Questions and answers 31-40

Get Full Version of the Exam
http://www.EnsurePass.com/70-487.html

Question No.31

You are developing a library management application that uses the ADO.NET Entity Framework against a SQL Server database. The application has a method that returns check outs filtered by date.

The Book class is shown below.

image

You must filter the data on the SQL server before it is returned to the application server. You need to return books checked out more recently than the entered date.

Which code segment should you use?

image

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Answer: A

Explanation/Reference:

Explanation:

The difference is that IQueryablelt;Tgt; is the interface that allows LINQ-to-SQL (LINQ.-to- anything really) to work. So if you further refine your query on an IQueryablelt;Tgt;, that query will be executed in the database, if possible.

For the IEnumerablelt;Tgt; case, it will be LINQ-to-object, meaning that all objects matching the original query will have to be loaded into memory from the database.

Question No.32

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 question 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 have developed a .NET Standard Library. You need to produce a NuGet package.

Solution: Run the msbuild command with the publish target specified. Does the solution meet the goal?

A.

Yes

B.

No

Answer: B

Explanation/Reference:

Explanation:

Package the component with the NuGet pack command.

References:

https://docs.microsoft.com/en-us/nuget/guides/create-net-standard-packages-vs2015

Question No.33

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 question 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 are developing a RESTful API that uses ASP.NET Core. You plan to host the API in Azure App Services. You provision a development environment in the application service.

Developers must be able to deploy the API to the development environment. You must not share the Azure account credentials with developers.

You need to ensure that developers can deploy the API to the development environment.

Solution: Download the Publish profile for the application service and share it with the developers. Use Microsoft Visual Studio Publishing.

Does the solution meet the goal?

A.

Yes

B.

No

Answer: A

Explanation/Reference:

Explanation:

To configure deployment for a web project in Visual Studio, you create one or more publish profiles using the Publish Web wizard. A publish profile specifies the server you are deploying to, the credentials needed to log on to the server, the databases to deploy, and other deployment options. When you are ready to publish, you choose the profile you want to use and click the Publish button in the wizard or in the Web One Click Publish toolbar.

References:

https://msdn.microsoft.com/en-us/library/dd465337(v=vs.110).aspx

Question No.34

You have a web server that hosts several web applications.

From Microsoft Visual Studio, you create an assembly that is signed.

You need to make the assembly available to all of the web applications on the web server. The solution must minimize the number of copies of the assembly.

Which tool should you run?

A.

gacutil.exe

B.

sn.exe

C.

tlbImp.exe

D.

regasm.exe

Answer: B

Explanation/Reference:

Explanation:

Strong Name Scenario

The following scenario outlines the process of signing an assembly with a strong name and later referencing it by that name.

Assembly A is created with a strong name using one of the following methods: References:

https://docs.microsoft.com/en-us/dotnet/framework/app-domains/create-and-use-strong-named- assemblies

Question No.35

You deploy a RESTful ASP.NET Web API to manage order processing.

You are developing an Azure App Services Web App to consume the API and allow customers to order products. You use the HttpClient object to process order entries. The API throws SocketException errors when the Web App experiences a high volume of concurrent users.

You need to resolve the errors. What should you do?

A.

Implement a Using statement block when declaring the HttpClient object.

B.

Increase the value of the Timeout property when declaring the HttpClient object.

C.

Use the static modifier to declare the HttpClient object.

D.

Create a new HttpClient instance for each API request and use asynchronous method calls.

Answer: C

Explanation/Reference:

Explanation:

If the class that wraps the external resource is shareable and thread-safe, create a shared singleton instance or a pool of reusable instances of the class.

The following example uses a static HttpClient instance, thus sharing the connection across all requests.

public class SingleHttpClientInstanceController : ApiController

{

private static readonly HttpClient httpClient; static SingleHttpClientInstanceController()

{

httpClient = new HttpClient();

}

// This method uses the shared instance of HttpClient for every call to GetProductAsync. public async Tasklt;Productgt; GetProductAsync(string id)

{

var hostName = HttpContext.Current.Request.Url.Host;

var result = await httpClient.GetStringAsync(string.Format(quot; http://{0}:8080/api/… quot;, hostName)); return new Product { Name = result };

}

}

References:

https://docs.microsoft.com/en-us/azure/architecture/antipatterns/improper-instantiation/

Question No.36

You are developing a web application by using Microsoft .NET Framework 4.5.

You are creating a web client for the application. The web client will make REST calls to several web services.

You need to ensure that the web client meets the following requirements: Uses the Task class to perform asynchronous operations

image

Reuses recently resolved DNS lookups

image

Which object should you include in the solution?

A.

ServiceClient

B.

WebClient

C.

HttpClient

D.

WebRequest

Answer: C

Explanation/Reference:

Explanation:

https://www.c-sharpcorner.com/article/calling-web-api-using-httpclient/

Question No.37

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 question 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 are developing a RESTful API that uses ASP.NET Core. You plan to host the API in Azure App Services. You provision a development environment in the application service.

Developers must be able to deploy the API to the development environment. You must not share the Azure account credentials with developers.

You need to ensure that developers can deploy the API to the development environment.

Solution: Share the Publish profile for the application service with the developers. Use Web Matrix 2 for publishing.

Does the solution meet the goal?

A.

Yes

B.

No

Answer: B

Explanation/Reference:

Explanation:

You should use a Publishing Profile with Microsoft Visual Studio Publishing as WebMatrix enables developers to build websites, while Visual Studio Publishing is used to develop computer programs for Microsoft Windows, as well as web sites, web applications and web services.

References:

https://msdn.microsoft.com/en-us/library/dd465337(v=vs.110).aspx

Question No.38

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 question 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 a REST API that uses Node.js. The API will store data in Azure Cosmos DB. You plan to deploy the API to a new Azure App Services Web App. You create a new Web App by using the Azure portal.

The API must be deployed by using SFTP.

You need to provide the proper deployment credentials to deploy the API.

Solution: Download the. PublishSettings file and enter the username and password located in the file.

Does the solution meet the goal?

A.

Yes

B.

No

Answer: A

Explanation/Reference:

Explanation: Example:

# Get FTP publishing profile and query for publish URL and credentials

creds=($(az webapp deployment list-publishing-profiles name $webappname resource-group myResourceGroup \

-query quot;[?contains(publishMethod, #39;FTP#39;)].[publishUrl,userName,userPWD]quot; output tsv)) query quot;[?contains(publishMethod, #39;FTP#39;)].[publishUrl,userName,userPWD]quot; output tsv))

References:

https://docs.microsoft.com/en-us/azure/app-service/scripts/app-service-cli-deploy-ftp

Question No.39

You are developing an ASP.NET Core web application by using an Entity Framework code-first approach.

The application uses a SQLite database.

You make changes to the classes in the model. You must apply the changes to the database. You need to suggest an approach to reliably handle the Entity Framework migrations.

Which three actions should you perform? Each correct answer presents a part of the solution. NOTE: Each correct selection is worth one point.

A.

Modify the scaffolded migration script to drop the modified tables.

B.

Run the following command: dotnet ef database update

C.

Modify the scaffolded migration script to create new tables with the migration changes.

D.

Modify the scaffolded migration script to drop the existing database and create the new database.

E.

Run the following command: dotnet ef migrations add

Answer: CDE

Explanation/Reference:

Explanation:

E: Run dotnet ef migrations add InitialCreate to scaffold a migration and create the initial set of tables for the model.

C: You can workaround some of the SQLite limitations by manually writing code in your migrations to perform a table rebuild. A table rebuild involves renaming the existing table, creating a new table, copying data to the new table, and dropping the old table.

D: SQLite does not support all migrations (schema changes) due to limitations in SQLite. For new development, consider dropping the database and creating a new one rather than using migrations when your model changes.

References:

https://docs.microsoft.com/en-us/ef/core/get-started/netcore/new-db-sqlite https://docs.microsoft.com/en-us/ef/core/providers/sqlite/limitations

Question No.40

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 question 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 have developed a .NET Standard Library. You need to produce a NuGet package.

Solution: Run the NuGet pack command Does the solution meet the goal?

A.

Yes

B.

No

Answer: A

Explanation/Reference:

Explanation:

Package the component with the NuGet pack command, for example: nuget pack AppLogger.nuspec

This generates AppLogger.YOUR_NAME.1.0.0.nupkg.

References:

https://docs.microsoft.com/en-us/nuget/guides/create-net-standard-packages-vs2015

Get Full Version of 70-487 Dumps

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.