What should you do?
You are implementing a WCF service library.
You add a new code file that contains the following code segment.
namespace ContosoWCF
{
[ServiceContract]
public interface IRateService
{
[OperationContract]
decimal GetCurrentRate();
}
public partial class RateService : IRateService
{
public decimal GetCurrentRate()
{
decimal currentRate = GetRateFromDatabase();
return currentRate;
}
}
}
You build the service library and deploy its assembly to an IIS application.
You need to ensure that the GetCurrentRate method can be called from JavaScript.
What should you do?
Which two XML element types should you use?
You use Microsoft Visual Studio 2010 and Microsoft. NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database. You use Entity SQL of the ADO.NE Entity Framework to retrieve data from the database. You need to define a custom function in the conceptual model. You also need to ensure that the function calculates a value based on properties of the object. Which two XML element types should you use? (Each correct answer presents part of the solution. Choose two.)
Which code segment should you insert at line 02?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database. You create the classes shown in the following exhibit. You add the following code segment to the application. (Line numbers are included for reference only.)
01 Public Sub QueryPlayers(leagues As List(Of League))
02
03 End Sub
You create a LINQ query to retrieve a collection of Player objects. You need to ensure that the collection includes all the players from each team and every league. Which code segment should you insert at line 02?
What should you do?
You use Microsoft .NET Framework 4.0 to develop an application that uses LINQ to SQL.
The Product entity in the LINQ to SQL model contains a field named Productlmage. The Productlmage field holds a large amount of binary data.
You need to ensure that the Productlmage field is retrieved from the database only when it is needed by the application. What should you do?
Which two actions should you perform?
You are implementing an ASP.NET Web site.
The Web site contains a Web service named CustomerService.
The code-behind file for the CustomerService class contains the following code segment.
public class ProductService : System.Web.Services.WebService
{
public List<Product> GetProducts(int categoryID)
{
return GetProductsFromDatabase(categoryID);
}
}
You need to ensure that the GetProducts method can be called by using AJAX.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
What should you do?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application uses the ADO.NET Entity Framework to model entities. You need to create a database from your model. What should you do?
What are two possible ways to achieve this goal?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server 2008 database. You create classes by using LINQ to SQL based on the records shown in the exhibit. (Click the Exhibit button.) You need to create a LINQ query to retrieve a list of objects that contains the OrderID and CustomerID properties. You need to retrieve the total price amount of each Order record. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
Which query expression should you use?
You are developing a new feature in the application to display a list of all bundled products.
You need to write a LINQ query that will return a list of all bundled products. Which query expression should you use?
Which code segment should you use?
You are implementing an ASP.NET application.
You add the following code segment.
public List<Person> GetNonSecretUsers()
{
string[] secretUsers = {“@secretUser”, “@admin”, “@root”};
List<Person> allpeople = GetAllPeople();
…
}
You need to add code to return a list of all Person objects except those with a UserId that is contained in the secretUsers list.
The resulting list must not contain duplicates.
Which code segment should you use?
Which two procedures should you add to the @productId parameter?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. You create stored procedures by using the following signatures:
“CREATE procedure [dbo].[Product_Insert](@name varchar(50),@price float)
“CREATE procedure [dbo].[Product_Update](@id int, @name varchar(50), @price float)
“CREATE procedure [dbo].[Product_Delete](@id int)
“CREATE procedure [dbo].[Order_Insert](@productId int, @quantity int)
“CREATE procedure [dbo].[Order_Update](@id int, @quantity int,@originalTimestamp timestamp)
“CREATE procedure [dbo].[Order_Delete](@id int)
You create a Microsoft ADO.NET Entity Data Model (EDM) by using the Product and Order entities as shown in the exhibit. You need to map the Product and Order entities to the stored procedures. Which two procedures should you add to the @productId parameter? (Each correct answer presents part of the solution. Choose two.)