Quiz 2 Spring 2022 Page 2 of 2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

3/16/22, 11:56 AM Quiz 2 Spring 2022 (page 2 of 2)

Question 11
Answer saved
Marked out of 1.00

Which of the following is one of the basic features of Dependency


Injection (DI)?

a. Maintenance

b. Deployment

c. Registration

d. Implementation

Clear my choice

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=179605&cmid=11457&page=1 1/12
3/16/22, 11:56 AM Quiz 2 Spring 2022 (page 2 of 2)

Question 12
Answer saved
Marked out of 1.00

Which of the following ways can be used to implement the Dependency


Injection in the .NET application?

a. Constructor Injection

b. None of the others

c. Method Injection

d. All of the others

e. Property Injection

Clear my choice

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=179605&cmid=11457&page=1 2/12
3/16/22, 11:56 AM Quiz 2 Spring 2022 (page 2 of 2)

Question 13
Answer saved
Marked out of 1.00

Suppose that you want to configure the root folder for Razor Pages to be
something other than the default. What the following code
should you put in
ConfigureServices method of Startup.cs file?

a. public void
ConfigureServices(IServiceCollection services)

{
            services.AddRazorPages().AddRazorPagesRootDirectory(options
=> {
            options.RootDirectory =
"/Content";
       
});
}

b.
public void
ConfigureServices(IServiceCollection services)
{
            services.AddRazorPages().AddRazorPagesOptions("/Content");
}

c. public void ConfigureServices(IServiceCollection


services)
{
            services.AddRazorPages().AddRazorPagesOptions(options
=> {
            options.RootDirectory =
"/Content";
       
});
}

d. public void
ConfigureServices(IServiceCollection services)

{
            services.AddRazorPages();

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=179605&cmid=11457&page=1 3/12
3/16/22, 11:56 AM Quiz 2 Spring 2022 (page 2 of 2)

Clear my choice

Question 14
Answer saved
Marked out of 1.00

The scaffolding tool features a number of generators including ones for


producing MVC areas, controllers and views, and Razor Pages.
Choose the
templates exist for Razor Pages.

a. Empty, Create, Edit, Delete, Details, List

b. Empty, AddNew, Edit, Delete, Details, ListAll

c. Empty, New, Edit, Delete, Details, List

d. Empty, Create, Edit, Delete, Details, ListAll

Clear my choice

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=179605&cmid=11457&page=1 4/12
3/16/22, 11:56 AM Quiz 2 Spring 2022 (page 2 of 2)

Question 15
Answer saved
Marked out of 1.00

To enable SignalR in the specific application, call the AddSignalR


extension method to configure the IoC container with services
required by
SignalR. Choose following code to add to ConfigureServices method (Startup.cs).

a. public void
ConfigureServices (IServiceCollection services)

{
    // ...
    services.AddSignalR();
}
 
public void
Configure(IApplicationBuilder app, HostingEnvironment env)
{
    // ...
    app.UseAuthentication();
    app.UseMvc();
   
    app.UseSignalR (builder =>
    {
        builder.MapHub<ChatHubClass>("/chat");
    });
}

b.
public void
ConfigureServices (IServiceCollection services)
{
    // ...

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=179605&cmid=11457&page=1 5/12
3/16/22, 11:56 AM Quiz 2 Spring 2022 (page 2 of 2)

    services.AddSignalR().Start();
}
 
public void
Configure(IApplicationBuilder app, HostingEnvironment env)
{
    // ...
    app.UseAuthentication();
    app.UseMvc();
   
    app.UseSignalR (builder =>
    {
        builder.MapHub< ChatHubClass
>("/chat").Start();
    });
}

c. None of the others.

Clear my choice

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=179605&cmid=11457&page=1 6/12
3/16/22, 11:56 AM Quiz 2 Spring 2022 (page 2 of 2)

Question 16
Answer saved
Marked out of 1.00

Which of the following statements related to the Inversion of Control


(IoC) is True?

a. It makes the application difficult to test and maintain

b. It is a design principle

c. It is used to invert different kinds of controls in object-oriented


design to achieve high coupling

d. All of the others


e. None of the others

Clear my choice

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=179605&cmid=11457&page=1 7/12
3/16/22, 11:56 AM Quiz 2 Spring 2022 (page 2 of 2)

Question 17
Answer saved
Marked out of 1.00

Choose the main purpose


of the Razor Pages PageModel class.

a. To provide the easy way to reduce the code for the UI components. 

b.
To provide the easy way
to understand the UI components with processing code logic for the page. 

c. To provide clear separation between the UI layer (the .cshtml view file)
and processing logic for the page.

d. To provide clear
separation between the UI layer (the .cshtml.cs view file) and processing logic
for the page. 

Clear my choice

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=179605&cmid=11457&page=1 8/12
3/16/22, 11:56 AM Quiz 2 Spring 2022 (page 2 of 2)

Question 18
Answer saved
Marked out of 1.00

Which of the following statements related to the Single Responsibility


Principle is True?

a. A class should be inherited from many other classes

b. A class should be implemented from multiple interfaces

c. A class should have only a single responsibility

d. None of the others

Clear my choice

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=179605&cmid=11457&page=1 9/12
3/16/22, 11:56 AM Quiz 2 Spring 2022 (page 2 of 2)

Question 19
Answer saved
Marked out of 1.00

SignalR provides two models for communicate between clients and severs:
Persistent Connections, Hubs. Choose the correct
information about Persistent
Connections.

a. Persistent Connections provide direct access to a low-level


communication protocol that signalR provides. Each client
connection to a
server is identified by a connectionID.

b. If you have multiple types of messages that you want to send between a
server and a client then it is recommended to use
Persistent Connections so you
do not need to do your own dispatching.

c. Persistent Connections provide a High-level API for the client and


server to call each other's method. It will be very familiar to
those
developers who have worked on remote invocation APIs.

d. None of the others.

Clear my choice

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=179605&cmid=11457&page=1 10/12
3/16/22, 11:56 AM Quiz 2 Spring 2022 (page 2 of 2)

Question 20
Answer saved
Marked out of 1.00

Choose the correct answer with Server-side validation in Razor Pages.

a.
if (!ModelState.IsValid)
{
    return Page();
}

b. if
(!ModelState.IsCorrect)

{
    return Page();
}

c. if
(!ModelState().IsValid())
{
    return Page();
}

d. if (!ModelState.IsTrue)

{
    return Page();
}

Clear my choice

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=179605&cmid=11457&page=1 11/12
3/16/22, 11:56 AM Quiz 2 Spring 2022 (page 2 of 2)

https://lms-hcmuni.fpt.edu.vn/mod/quiz/attempt.php?attempt=179605&cmid=11457&page=1 12/12

You might also like