Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1.  public class SoftDeleteInterceptor : IDbCommandTreeInterceptor
  2.     {
  3.         public void TreeCreated(DbCommandTreeInterceptionContext interceptionContext)
  4.         {
  5.             if (interceptionContext.OriginalResult.DataSpace!= DataSpace.SSpace)
  6.             {
  7.                 return;
  8.             }
  9.  
  10.             var tree = interceptionContext.Result as DbQueryCommandTree;
  11.  
  12.             if (tree == null)
  13.             {
  14.                 return;
  15.             }
  16.  
  17.             var newQuery = tree.Query.Accept(new SoftDeleteQueryVisitor());
  18.  
  19.             interceptionContext.Result = new DbQueryCommandTree(
  20.                 tree.MetadataWorkspace,
  21.                 tree.DataSpace,
  22.                 newQuery);
  23.         }
  24.     }