Which expression 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 application must provide a component part list for any product. The component part list must
give the quantity of each distinct part that is required to manufacture that product. You need to
create a LINQ expression that delivers a result of type IEnumerable<Tuple<int, Part>> to meet the
requirements. Which expression should you use?
What should you recommend?
You are preparing to deploy a solution that includes a Windows Forms application and
several COM components. Unsigned interop assemblies have been created for each of the
COM components. You need to recommend an approach for deploying the solution. What
should you recommend?
Which interface should you implement?
You are creating a Web Part in SharePoint Server 2010. You need to ensure that the Web Part
can send data to another Web Part. Which interface should you implement?
Which of the following queries 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###
You need to write a LINQ query that can be used against a ContosoEntities context object named
context to find all parts that have a duplicate name. Which of the following queries should you use?
(Each correct answer presents a complete solution. Choose two.)
You need to ensure that data transmissions between remote client computers and the corporate network are as se
Your company’s corporate network uses Network Access Protection (NAP). Users are able to connect
to the corporate network remotely. You need to ensure that data transmissions between remote
client computers and the corporate network are as secure as possible. What should you do?
Which query expression should you write?
###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 application UI displays a list of products in alphabetical order. To display each product, the UI
requires the va of the product Id field and the product Name field. You need to write a LINO query
that returns the product name and unique identifier without retrieving any other database columns.
The query must create an anonymous type with a field named ProductName that contains the
product name and a field named Id that contains the unique identifier. Which query expression
should you write?
What are two possible code segments that you can use to achieve this goal?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to develop an application.
You use the ADO.NET Entity Framework Designer to model entities. The application includes selftracking entities as shown in the following diagram.
There is a Person entity named person1 that has Track Changes turned on.
You need to delete all e-mail addresses that are associated with person1 by using an ObjectContext
named context. What are two possible code segments that you can use to achieve this goal? (Each
correct answer presents a complete solution. Choose two).
What should you recommend?
You are designing a multi-tenant Windows Presentation Foundation (WPF) application that
will connect to a Microsoft SQL Server 2008 database. The WPF application will change the
structure of database tables and views at runtime based on the tenant’s configuration. The
WPF application must meet the following requirements: Keep each tenant’s data separate.
Allow changes to the structure of the tables and views for each tenant without interfering
with other tenants’ data. You need to recommend an approach for managing the database
structure. What should you recommend?
Which two approaches could you recommend?
You are designing an ASP.NET Web application that displays daily sales information. The
sales information is stored in a large Microsoft SQL Server database. The database
information is updated each night. During the day, people use the Web application to
display a set of standard sales reports based on the latest database information. The SQL
queries that are required to retrieve the database information can take from 20 to 30
seconds to execute. You need to design the application to ensure that pages usually load in
no more than 5 seconds. Which two approaches could you recommend? (Each correct
answer presents a complete solution. Choose two.)
Which approach should you recommend?
Your company has a SharePoint 2010 Web application that contains multiple site
collections. You have a custom master page that will be used by every site collection in the
application. You need to make sure that changes made to this custom master page are
displayed across all site collections in the Web application. Which approach should you
recommend?