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?
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?
[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
);
}
https://msdn.microsoft.com/en-us/library/system.data.services.queryinterceptorattribute(v=vs.113).aspx