How should you build the method?

You are developing a WCF Data Services service in Visual Studio 2012 to display movie information froma
SQL Server database that changes every 24 hours. The service is defined in the following class :

The service must only return data for movies that are currently in theaters. You need to add a method to the
MovieService class to filter the data. How should you build the method?

You are developing a WCF Data Services service in Visual Studio 2012 to display movie information froma
SQL Server database that changes every 24 hours. The service is defined in the following class :

The service must only return data for movies that are currently in theaters. You need to add a method to the
MovieService class to filter the data. How should you build the method?

Answer:

Explanation:



Leave a Reply 2

Your email address will not be published. Required fields are marked *


Jules

Jules

[QueryInterceptor(“Orders”)]
public Expression<Func> FilterOrders()
{
return o => o.Customer.Name == /* Current principal name. */;
}

// Insures that the user accessing the customer(s) has the appropriate
// rights as defined in the QueryRules object to access the customer
// resource(s).

[QueryInterceptor (“Customers”)]
public Expression<Func> FilterCustomers()
{
return c => c.Name == /* Current principal name. */ &&
this.CurrentDataSource.QueryRules.Contains(
rule => rule.Name == c.Name &&
rule.CustomerAllowedToQuery == true
);
}