Which code segment should you use?
###BeginCaseStudy###
Case Study: 1
Background
You are updating an existing Microsoft .NET Framework 4 application that includes a data
layer built with ADO.NET Entity Framework 4. The application communicates with a
Microsoft SQL Server 2008 instance named INST01 on a server named SQL01. The
application stores data in a database named Contoso in the INST01 instance.
You need to update the existing technology and develop new functionality by using
Microsoft Visual Studio 2010.
Application and Database Storage
The application tracks bicycle parts as they pass through a factory. Parts are represented by
the abstract Part entity and its associated partial classes. Each part has a name stored in the
Name field and a unique identifier stored in the Id field.
Parts are either component s (represented by the Component class) such as chains, wheels,
and frames, or finished product s (represented by the Product class) such as completed
bicycles. The Component class and the Product class derive from the Part class and may
contain additional class-specific properties.
Parts may have a color (represented by the Color class), but not all parts have a color, Parts
may be composed of other parts, and those parts may in turn be composed of other parts ; any
p art represents a tree of the parts that are used to build it, The lowest level of the tree consists
of c omponents that do not contain other component s.
A p roduct is a p art that has been completed and is ready to leave the factory. A p roduct
typically consists of many c omponents (forming a tree of child p arts) but can also be
constructed by combining other p roducts and/or c omponents to form a bundled p roduct,
such as a bicycle and a helmet that are sold together.
C omponents and p roducts are stored in a database table named Parts by using a table-perhierarchy (TPH) mapping. Components have a null ProductType field and a non-null
PartType field. Products have a non-null ProductType field and a null PartType field.
The following diagram illustrates the complete Entity data model diagram (EDMX diagram),
The following graphic illustrates detail s of the Part-Color Association.
The following code segments show relevant portions of the files referenced by the case study
items. (Line numbers in the samples below are included for reference only and include a twocharacter prefix that denotes the specific file to which they belong.)
Extension Methods.vb
Model.edmx
Model/Color.vb
Model/Component.vb
ModelContosoEntities.vb
Model IName.vb
Model Part.vb
Model Product.vb
sp_FindObsolete
###EndCaseStudy###
The database contains orphaned Color records that are no longer connected to Part records. You
need to clean up the orphaned records. You have an existing ContosoEntities context object named
context. Which code segment should you use?
You need to update the application to support the creation of an XElement object having a structure that will
###BeginCaseStudy###
Case Study: 1
Background
You are updating an existing Microsoft .NET Framework 4 application that includes a data
layer built with ADO.NET Entity Framework 4. The application communicates with a
Microsoft SQL Server 2008 instance named INST01 on a server named SQL01. The
application stores data in a database named Contoso in the INST01 instance.
You need to update the existing technology and develop new functionality by using
Microsoft Visual Studio 2010.
Application and Database Storage
The application tracks bicycle parts as they pass through a factory. Parts are represented by
the abstract Part entity and its associated partial classes. Each part has a name stored in the
Name field and a unique identifier stored in the Id field.
Parts are either component s (represented by the Component class) such as chains, wheels,
and frames, or finished product s (represented by the Product class) such as completed
bicycles. The Component class and the Product class derive from the Part class and may
contain additional class-specific properties.
Parts may have a color (represented by the Color class), but not all parts have a color, Parts
may be composed of other parts, and those parts may in turn be composed of other parts ; any
p art represents a tree of the parts that are used to build it, The lowest level of the tree consists
of c omponents that do not contain other component s.
A p roduct is a p art that has been completed and is ready to leave the factory. A p roduct
typically consists of many c omponents (forming a tree of child p arts) but can also be
constructed by combining other p roducts and/or c omponents to form a bundled p roduct,
such as a bicycle and a helmet that are sold together.
C omponents and p roducts are stored in a database table named Parts by using a table-perhierarchy (TPH) mapping. Components have a null ProductType field and a non-null
PartType field. Products have a non-null ProductType field and a null PartType field.
The following diagram illustrates the complete Entity data model diagram (EDMX diagram),
The following graphic illustrates detail s of the Part-Color Association.
The following code segments show relevant portions of the files referenced by the case study
items. (Line numbers in the samples below are included for reference only and include a twocharacter prefix that denotes the specific file to which they belong.)
Extension Methods.vb
Model.edmx
Model/Color.vb
Model/Component.vb
ModelContosoEntities.vb
Model IName.vb
Model Part.vb
Model Product.vb
sp_FindObsolete
###EndCaseStudy###
Refer to the following lines in the case study: PA42 in \Model\Part.vb, PR16 in \Model\Product.vb,
and CT14 in \Model\Component.vb. The application must create XML files that detail the part
structure for any product. The XML files must use the following format:
<?xml version=”1.0″ encoding=”utf-8″?>
<product name=”Brush” description=”Brush product” productType=”1″>
<component name=”Handle” description=”Handle” partType=”2″>
<component name=”Screw” description=”Screw” partType=”3″ />
<component name=”Wood” description=”Wooden shaft” partType=”45″ />
</component>
<component name=”Head” description=”Head” partType=”5″>
<component name=”Screw” description=”Screw” partType=”3″ />
<component name=”Bristles” description=”Bristles” partType=”4″ />
</component> </product>
You need to update the application to support the creation of an XElement object having a structure
that will serialize to the format shown above. What should you do? (Each correct answer presents
part of the solution. Choose two.)
Which two actions should you recommend?
You are designing a health monitoring strategy for an ASP.NET Web application. The Web
application must raise failure events to correspond with key business process failures. You
need to recommend an approach for ensuring that failure events can be consumed by the
ASP.NET Health Monitoring framework. Which two actions should you recommend? (Each
correct answer presents part of the solution. Choose two.)
Which method should you use?
You create a Microsoft .NET Framework console application that uses a Representational State
Transfer (REST) API to query a custom list named Products. The application contains the
following code segment. AdventureWorksDataContext codc = new
AdventureWorksDataContext(new Uri(“http:// contoso/_vti_bin/listdata.svc”)); codc.Credentials =
CredentialCache.DefaultCredentials; You need to read all items in Products into an object. Which
method should you use?
You need to update the database with the changed data from part1
###BeginCaseStudy###
Case Study: 1
Background
You are updating an existing Microsoft .NET Framework 4 application that includes a data
layer built with ADO.NET Entity Framework 4. The application communicates with a
Microsoft SQL Server 2008 instance named INST01 on a server named SQL01. The
application stores data in a database named Contoso in the INST01 instance.
You need to update the existing technology and develop new functionality by using
Microsoft Visual Studio 2010.
Application and Database Storage
The application tracks bicycle parts as they pass through a factory. Parts are represented by
the abstract Part entity and its associated partial classes. Each part has a name stored in the
Name field and a unique identifier stored in the Id field.
Parts are either component s (represented by the Component class) such as chains, wheels,
and frames, or finished product s (represented by the Product class) such as completed
bicycles. The Component class and the Product class derive from the Part class and may
contain additional class-specific properties.
Parts may have a color (represented by the Color class), but not all parts have a color, Parts
may be composed of other parts, and those parts may in turn be composed of other parts ; any
p art represents a tree of the parts that are used to build it, The lowest level of the tree consists
of c omponents that do not contain other component s.
A p roduct is a p art that has been completed and is ready to leave the factory. A p roduct
typically consists of many c omponents (forming a tree of child p arts) but can also be
constructed by combining other p roducts and/or c omponents to form a bundled p roduct,
such as a bicycle and a helmet that are sold together.
C omponents and p roducts are stored in a database table named Parts by using a table-perhierarchy (TPH) mapping. Components have a null ProductType field and a non-null
PartType field. Products have a non-null ProductType field and a null PartType field.
The following diagram illustrates the complete Entity data model diagram (EDMX diagram),
The following graphic illustrates detail s of the Part-Color Association.
The following code segments show relevant portions of the files referenced by the case study
items. (Line numbers in the samples below are included for reference only and include a twocharacter prefix that denotes the specific file to which they belong.)
Extension Methods.vb
Model.edmx
Model/Color.vb
Model/Component.vb
ModelContosoEntities.vb
Model IName.vb
Model Part.vb
Model Product.vb
sp_FindObsolete
###EndCaseStudy###
You are adding a process to the application. The process performs the following actions:
1. Opens a ContosoEntities context object named context1.
2. Loads a Part object into a variable named part1.
3. Calls the Dispose() method on context1.
4. Updates the data in part1.
5. Updates the database by using a new ContosoEntities context object named context2.
You need to update the database with the changed data from part1.
What should you do?
What should you modify?
Your network contains two DHCP servers named Server1 and Server2. Server1 and Server2 are
located in the same subnet. You configure a split scope named Scope1 on the DHCP servers. You
need to ensure that Server2 only responds to DHCP client requests if Server1 is unavailable. What
should you modify?
You need to complete the configuration in the dialog box
###BeginCaseStudy###
Case Study: 1
Background
You are updating an existing Microsoft .NET Framework 4 application that includes a data
layer built with ADO.NET Entity Framework 4. The application communicates with a
Microsoft SQL Server 2008 instance named INST01 on a server named SQL01. The
application stores data in a database named Contoso in the INST01 instance.
You need to update the existing technology and develop new functionality by using
Microsoft Visual Studio 2010.
Application and Database Storage
The application tracks bicycle parts as they pass through a factory. Parts are represented by
the abstract Part entity and its associated partial classes. Each part has a name stored in the
Name field and a unique identifier stored in the Id field.
Parts are either component s (represented by the Component class) such as chains, wheels,
and frames, or finished product s (represented by the Product class) such as completed
bicycles. The Component class and the Product class derive from the Part class and may
contain additional class-specific properties.
Parts may have a color (represented by the Color class), but not all parts have a color, Parts
may be composed of other parts, and those parts may in turn be composed of other parts ; any
p art represents a tree of the parts that are used to build it, The lowest level of the tree consists
of c omponents that do not contain other component s.
A p roduct is a p art that has been completed and is ready to leave the factory. A p roduct
typically consists of many c omponents (forming a tree of child p arts) but can also be
constructed by combining other p roducts and/or c omponents to form a bundled p roduct,
such as a bicycle and a helmet that are sold together.
C omponents and p roducts are stored in a database table named Parts by using a table-perhierarchy (TPH) mapping. Components have a null ProductType field and a non-null
PartType field. Products have a non-null ProductType field and a null PartType field.
The following diagram illustrates the complete Entity data model diagram (EDMX diagram),
The following graphic illustrates detail s of the Part-Color Association.
The following code segments show relevant portions of the files referenced by the case study
items. (Line numbers in the samples below are included for reference only and include a twocharacter prefix that denotes the specific file to which they belong.)
Extension Methods.vb
Model.edmx
Model/Color.vb
Model/Component.vb
ModelContosoEntities.vb
Model IName.vb
Model Part.vb
Model Product.vb
sp_FindObsolete
###EndCaseStudy###
The entity data model must be configured to provide a way to call the sp_FindObsolete stored
procedure. The returned data must implement the Descendants property. In Visual Studio 2010, you
open the Add Function Import dialog box from the EDMX diagram and enter the information shown
in the following graphic.
You need to complete the configuration in the dialog box. What should you do?
You need to ensure that a call to SaveChanges() on the context object does not generate this exception
###BeginCaseStudy###
Case Study: 1
Background
You are updating an existing Microsoft .NET Framework 4 application that includes a data
layer built with ADO.NET Entity Framework 4. The application communicates with a
Microsoft SQL Server 2008 instance named INST01 on a server named SQL01. The
application stores data in a database named Contoso in the INST01 instance.
You need to update the existing technology and develop new functionality by using
Microsoft Visual Studio 2010.
Application and Database Storage
The application tracks bicycle parts as they pass through a factory. Parts are represented by
the abstract Part entity and its associated partial classes. Each part has a name stored in the
Name field and a unique identifier stored in the Id field.
Parts are either component s (represented by the Component class) such as chains, wheels,
and frames, or finished product s (represented by the Product class) such as completed
bicycles. The Component class and the Product class derive from the Part class and may
contain additional class-specific properties.
Parts may have a color (represented by the Color class), but not all parts have a color, Parts
may be composed of other parts, and those parts may in turn be composed of other parts ; any
p art represents a tree of the parts that are used to build it, The lowest level of the tree consists
of c omponents that do not contain other component s.
A p roduct is a p art that has been completed and is ready to leave the factory. A p roduct
typically consists of many c omponents (forming a tree of child p arts) but can also be
constructed by combining other p roducts and/or c omponents to form a bundled p roduct,
such as a bicycle and a helmet that are sold together.
C omponents and p roducts are stored in a database table named Parts by using a table-perhierarchy (TPH) mapping. Components have a null ProductType field and a non-null
PartType field. Products have a non-null ProductType field and a null PartType field.
The following diagram illustrates the complete Entity data model diagram (EDMX diagram),
The following graphic illustrates detail s of the Part-Color Association.
The following code segments show relevant portions of the files referenced by the case study
items. (Line numbers in the samples below are included for reference only and include a twocharacter prefix that denotes the specific file to which they belong.)
Extension Methods.vb
Model.edmx
Model/Color.vb
Model/Component.vb
ModelContosoEntities.vb
Model IName.vb
Model Part.vb
Model Product.vb
sp_FindObsolete
###EndCaseStudy###
You have an existing ContosoEntities context object named context. Calling the SaveChanges()
method on the context object generates an exception that has the following inner exception:
System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object ‘dbo.Colors’ with
unique index ‘IX_Colors’.
You need to ensure that a call to SaveChanges() on the context object does not generate this
exception.
What should you do?
Which plan should you recommend?
You are planning security for a SharePoint 2010 intranet site. A subsite for the human
resources (HR) department contains a list of salary information. All the HR department
employees are in an Active Directory (AD) group named SharePoint HR. The SharePoint
HR AD group has been granted Read access to the subsite. You have the following
requirements: ·Access to the list should be handled only through the HR department group.
.The group membership of the AD HR group should be used to specifiy the site
permissions. .The department’s administrative assistant should not have access to view the
salary list. You need to ensure that permissions are configured on the subsite to meet these
requirements. Which plan should you recommend?
You need to enable detection of unauthorized changes to the row values
###BeginCaseStudy###
Case Study: 1
Background
You are updating an existing Microsoft .NET Framework 4 application that includes a data
layer built with ADO.NET Entity Framework 4. The application communicates with a
Microsoft SQL Server 2008 instance named INST01 on a server named SQL01. The
application stores data in a database named Contoso in the INST01 instance.
You need to update the existing technology and develop new functionality by using
Microsoft Visual Studio 2010.
Application and Database Storage
The application tracks bicycle parts as they pass through a factory. Parts are represented by
the abstract Part entity and its associated partial classes. Each part has a name stored in the
Name field and a unique identifier stored in the Id field.
Parts are either component s (represented by the Component class) such as chains, wheels,
and frames, or finished product s (represented by the Product class) such as completed
bicycles. The Component class and the Product class derive from the Part class and may
contain additional class-specific properties.
Parts may have a color (represented by the Color class), but not all parts have a color, Parts
may be composed of other parts, and those parts may in turn be composed of other parts ; any
p art represents a tree of the parts that are used to build it, The lowest level of the tree consists
of c omponents that do not contain other component s.
A p roduct is a p art that has been completed and is ready to leave the factory. A p roduct
typically consists of many c omponents (forming a tree of child p arts) but can also be
constructed by combining other p roducts and/or c omponents to form a bundled p roduct,
such as a bicycle and a helmet that are sold together.
C omponents and p roducts are stored in a database table named Parts by using a table-perhierarchy (TPH) mapping. Components have a null ProductType field and a non-null
PartType field. Products have a non-null ProductType field and a null PartType field.
The following diagram illustrates the complete Entity data model diagram (EDMX diagram),
The following graphic illustrates detail s of the Part-Color Association.
The following code segments show relevant portions of the files referenced by the case study
items. (Line numbers in the samples below are included for reference only and include a twocharacter prefix that denotes the specific file to which they belong.)
Extension Methods.vb
Model.edmx
Model/Color.vb
Model/Component.vb
ModelContosoEntities.vb
Model IName.vb
Model Part.vb
Model Product.vb
sp_FindObsolete
###EndCaseStudy###
You add a table to the database to track changes to part names. The table stores the following row
values:
• the username of the user who made the change
• a part ID
• the new
• part name
• a DateTime value
You need to enable detection of unauthorized changes to the row values. You also need to ensure
that database users can view the original row values. What should you do?