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 Data Structure
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 components (represented by the Component class) such as chains, wheels,
and frames, or finished products (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
part represents a tree of the parts that are used to build it. The lowest level of the tree consists
of components that do not contain other components.
A product is a part that has been completed and is ready to leave the factory. A product
typically consists of many components (forming a tree of child parts) but can also be
constructed by combining other products and/or components to form a bundled product, such
as a bicycle and a helmet that are sold together.
Components and products 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 details 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 Method.cs
Model.edmx
Model/Color.cs
Model/component.cs
Model ContosoEntities.cs
Model IName.cs
Model Part.cs
Model/Product.cs
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?
Which two actions should you recommend?
You are designing updates to an existing Windows Presentation Foundation (WPF)
application that connects to a Microsoft SQL Server 2008 database. The application
updates will require updates to the database. You have the following requirements: Prevent
data loss. Recover the database if the database update fails. You need to recommend a
database deployment strategy. Which two actions should you recommend? (Each correct
answer presents part of the solution. Choose two.)
You need to ensure that an exception is thrown when color names are set to less than two characters
###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 Data Structure
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 components (represented by the Component class) such as chains, wheels,
and frames, or finished products (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
part represents a tree of the parts that are used to build it. The lowest level of the tree consists
of components that do not contain other components.
A product is a part that has been completed and is ready to leave the factory. A product
typically consists of many components (forming a tree of child parts) but can also be
constructed by combining other products and/or components to form a bundled product, such
as a bicycle and a helmet that are sold together.
Components and products 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 details 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 Method.cs
Model.edmx
Model/Color.cs
Model/component.cs
Model ContosoEntities.cs
Model IName.cs
Model Part.cs
Model/Product.cs
SP_FindObsolete
###EndCaseStudy###
You need to ensure that an exception is thrown when color names are set to less than two
characters. What should you do?
You need to ensure that you can activate or deactivate the script at the site level
You have several SharePoint sites. You plan to load a custom script in all pages of the sites. You
need to ensure that you can activate or deactivate the script at the site level. What should you do?
You need to ensure that client traffic from Site3 and Site4 is distributed between Server1 and Server2
Your network contains an Active Directory domain named contoso.com. All server run Windows
Server 2008 R2. The topology of the Active Directory site is configured as shown in the exhibit. (Click
the Exhibit button.)
Server1 and Server2 host a Distributed File System (DFS) replica named \\contoso.com\dfs\Folder1.
You discover that client computers in Site3 and Site4 always contact Server1 when they access files
in \\contoso.com\dfs\Folder1. You need to ensure that client traffic from Site3 and Site4 is
distributed between Server1 and Server2. What should you do?
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 Data Structure
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 components (represented by the Component class) such as chains, wheels,
and frames, or finished products (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
part represents a tree of the parts that are used to build it. The lowest level of the tree consists
of components that do not contain other components.
A product is a part that has been completed and is ready to leave the factory. A product
typically consists of many components (forming a tree of child parts) but can also be
constructed by combining other products and/or components to form a bundled product, such
as a bicycle and a helmet that are sold together.
Components and products 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 details 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 Method.cs
Model.edmx
Model/Color.cs
Model/component.cs
Model ContosoEntities.cs
Model IName.cs
Model Part.cs
Model/Product.cs
SP_FindObsolete
###EndCaseStudy###
Refer to the following lines in the case study: PA40 in \Model\Part.cs, PR16 in \Model\Product.cs,
and CT14 in \Model\Component.cs.
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.)
What should you recommend?
You are designing a .NET Framework 4 solution that contains a Windows Presentation
Foundation (WPF) application and a Windows Communication Framework (WCF) Web
service. The WPF application will be deployed to users’ desktops located in the company’s
corporate network. The WCF Web service will be deployed to a Web farm located in the
company’s perimeter network. The firewall between the perimeter network and the Internet
allows only HTTP and HTTPS traffic. You need to recommend an approach for minimizing
the attack surface of the WCF Web service. What should you recommend?
What should you recommend?
You are designing an ASP.NET Web application. A page of the Web application will allow
users to post comments and view comments posted by other users. You need to
recommend an approach for preventing the Web application from storing malicious content.
What should you recommend?
Which approach should you recommend?
You are planning an upgrade from an existing Microsoft Office SharePoint Server (MOSS)
2007 farm to a SharePoint 2010 farm. The existing farm contains customized master pages.
These master pages include modifications of the: ·Publishing Console .Site Actions Menu
.Log-in Control Your design must specify an upgrade to the existing master pages to
function correctly in SharePoint 2010. Which approach should you recommend?
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 Data Structure
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 components (represented by the Component class) such as chains, wheels,
and frames, or finished products (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
part represents a tree of the parts that are used to build it. The lowest level of the tree consists
of components that do not contain other components.
A product is a part that has been completed and is ready to leave the factory. A product
typically consists of many components (forming a tree of child parts) but can also be
constructed by combining other products and/or components to form a bundled product, such
as a bicycle and a helmet that are sold together.
Components and products 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 details 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 Method.cs
Model.edmx
Model/Color.cs
Model/component.cs
Model ContosoEntities.cs
Model IName.cs
Model Part.cs
Model/Product.cs
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?