title: Operation instead of query interceptor (WCF Data Services)
body: <p>I was reading about <a href="http://msdn.microsoft.com/en-us/library/dd744842%28v=vs.110%29.aspx" rel="nofollow">query interceptors</a>. I was disappointed because thats more like a filter instead of an interceptor. In other words you can eather include records or not include them. You are not able to modify records for instance.</p>
  
  <p>If I want to create a query interceptor for my entity <code>Users</code> I could then do something like:</p>
  
  <pre><code>[QueryInterceptor("Users")] // apply to table users
  public Expression&lt;Func&lt;User, bool&gt;&gt; UsersOnRead()
  {
      return cust =&gt; cust.IsDeleted == false;
  }
  </code></pre>
  
  <p><strong>What if I instead create the operation:</strong>  <em>NOTE IS VERY IMPORTANT TO HAVE THE OPERATION NAME JUST LIKE THE ENTITY NAME OTHERWISE IT WILL NOT WORK</em></p>
  
  <pre><code>[WebGet]
  public IEnumerable&lt;User&gt; Users()
  {                    
      return this.CurrentDataSource.Users.Where(x=&gt;x.IsDeleted==false);
  }
  </code></pre>
  
  <p>Placing this method instead of the query interceptor makes my service behave exactly the same. Plus I have more power! Is taking this approach a better solution?</p>