I'm looking at implementing some LINQ to SQL but am struggling to see how we woudl add in access control business rules such as customer a can only view their orders. In ado.net data services, query intercptors do exactly what I am after, and can see how to check on update / insert / delete, but is there an equivalent of this:
[QueryInterceptor("Orders")]
public IQueryable<Orders> OnQueryOrders(IQueryable<Orders> orderQuery)
{
return from o in orderQuery
where o.Customers.ContactName == HttpContext.Current.User.Identity.Name
select o;
}
Or wil I need to control via accessors along the line of: GetOrdersByCustomer(string customerId)