This question is locked. New answers and comments are not allowed.
Am using latest ORM WCF Data services odata 3.0 and would like to implement authorization. I could not find where i should write QueryInterceptor.
In EntitiesModelService.svc.cs i have only InitializeService method!
Where i can write below code?
[QueryInterceptor("Orders")]
public Expression<Func<Order, bool>> OnQueryOrders()
{
// Filter the returned orders to only orders
// that belong to a customer that is the current user.
return o => o.Customer.ContactName ==
HttpContext.Current.User.Identity.Name;
}
In EntitiesModelService.svc.cs i have only InitializeService method!
Where i can write below code?
[QueryInterceptor("Orders")]
public Expression<Func<Order, bool>> OnQueryOrders()
{
// Filter the returned orders to only orders
// that belong to a customer that is the current user.
return o => o.Customer.ContactName ==
HttpContext.Current.User.Identity.Name;
}