100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

PRN221 P2 EXAM QUESTIONS WITH CORRECT ANSWERS |LATEST UPDATE 100% SOLVED| GRADED A+

Rating
-
Sold
-
Pages
32
Grade
A+
Uploaded on
10-04-2025
Written in
2024/2025

PRN221 P2 EXAM QUESTIONS WITH CORRECT ANSWERS |LATEST UPDATE 100% SOLVED| GRADED A+

Institution
PRN221
Course
PRN221











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
PRN221
Course
PRN221

Document information

Uploaded on
April 10, 2025
Number of pages
32
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

PRN221 P2 EXAM QUESTIONS WITH CORRECT ANSWERS |LATEST UPDATE 100%
SOLVED| GRADED A+


b Which of the following is one of the basic features of Dependency Injection (DI)?
a. Maintenance
b. Registration
c. Implementation
d. Deployment



a Give the block of code
[XmlRoot("Candidate")]
public class Person {
[XmlElement("FirstName")]
public string Name { get; set; }
[XmlElement("RoughAge")]
public int Age { get; set; }
}
class Program{
static void Main(string[] args){
Person p1 = new Person() { Name="David", Age=30 };
var xs = new XmlSerializer(typeof(Person));
using Stream s1 = File.Create("pe.xml");
xs.Serialize(s1, p1);
s1.Close();
using Stream s2 = File.OpenRead("person.xml");
var p2 = (Person)xs.Deserialize(s2);
Console.WriteLine("****Person Info****");

,Console.WriteLine($"Name: {p2.Name}, Age: {p2.Age}");
s2.Close();
Console.ReadLine();
}
}
Choose the result.
a. Throws an exception
b. ****Person Info****
<?xml version="1.0"?>
<Candidate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<FirstName>David</FirstName>
<RoughAge>30</RoughAge>
</Candidate>
c. ****Person Info****
Name: David, Age: 30
d. Syntax Error



b Model Binding in Razor Pages is the process that takes values from HTTP requests and
maps them to handler method parameters or
PageModel properties. Choose the correct way to bind the posted form values to handler
method parameters.
a. [BindProperties]
public class ModelBindingDemo : PageModel
{
[BindProperty]
public string Name { get; set; }
[BindProperty]

,public string Email { get; set; }
public void OnGet()
{
}
public void OnPost()
{
ViewData["confi rmation"] = $"{Name}, information will be sent to {Email}";
}
}
b. public class ModelBindingDemo : PageModel
{
[BindProperty]
public string Name { get; set; }
[BindProperty]
public string Email { get; set; }
public void OnGet()
{
}
public void OnPost()
{
ViewData["confi rmation"] = $"{Name}, information will be sent to {Email}";
}
}
c. public class ModelBindingDemo : PageModel
{
public void OnGet()
{

, }
public void OnPost(string name, string email)
{
ViewData["confi rmation"] = $"{name}, information will be sent to {email}";
}
}
d. [BindProperties]
public class ModelBindingDemo : PageModel
{
public void OnGet()
{
}
public void OnPost(string name, string email)
{
ViewData["confi rmation"] = $"{name}, information will be sent to {email}";
}
}



b The scaff olding 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, AddNew, Edit, Delete, Details, ListAll
b. Empty, Create, Edit, Delete, Details, List
c. Empty, New, Edit, Delete, Details, List
d. Empty, Create, Edit, Delete, Details, ListAll



c Which of the following statements related to Interface Segregation Principle is True?

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Copilot Harvard University
View profile
Follow You need to be logged in order to follow users or courses
Sold
21
Member since
1 year
Number of followers
0
Documents
4415
Last sold
1 month ago
A+ GRADES

ON THIS PAGE YOU WILL FIND VERIFIED STUDY MATERIALS TO BOOST YOUR CAREERS. (EXAMS, STUDY GUIDES, TEST BANKS, PRACTICE TEST QUESTIONS, TEXT BOOKS &amp; CLASS NOTES FOR ALL COURSES) LETS WORK SMART TO EXCEL, WELCOME!!!

4.9

8 reviews

5
7
4
1
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions