locked
Can QueryInterceptor intercept more than one entity? RRS feed

  • Question

  • Hi, 

    I have 20+ entities/tables and they all have a common field that I need to filter. I really don't want to write 20+ query interception methods if there's a better way. 

     

    Code Snippet

    [QueryInterceptor("*")]  <-- is this possible? if not, what are alternatives other than writing 20+ Query Interception methods?

     

    Thanks.

     

    Friday, November 4, 2011 4:03 PM

Answers

  • Currently there is no workaround other than what you are discussing as the solution. Perhaps you can just make one function and then have all 20 query interceptors call it.

    On our DataServices future feature voting site there is already a similar request. Perhaps you can up vote this or add a different one that more fully addresses your concerns

    http://data.uservoice.com/forums/72027-wcf-data-services-feature-suggestions/suggestions/1012627-add-more-extensibility-points-to-give-query-interc?ref=title

    In our current CTP that we released and our upcoming RTM we haven't added this functionality. When we iterate on our next version after this current release we will be taking customer concerns into account so please go through the list and add/vote on issues that are important for you in WCF Data Services.

    Thanks,

    Chris Robinson - OData Test Team


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, November 4, 2011 4:36 PM
    Moderator

All replies

  • Currently there is no workaround other than what you are discussing as the solution. Perhaps you can just make one function and then have all 20 query interceptors call it.

    On our DataServices future feature voting site there is already a similar request. Perhaps you can up vote this or add a different one that more fully addresses your concerns

    http://data.uservoice.com/forums/72027-wcf-data-services-feature-suggestions/suggestions/1012627-add-more-extensibility-points-to-give-query-interc?ref=title

    In our current CTP that we released and our upcoming RTM we haven't added this functionality. When we iterate on our next version after this current release we will be taking customer concerns into account so please go through the list and add/vote on issues that are important for you in WCF Data Services.

    Thanks,

    Chris Robinson - OData Test Team


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, November 4, 2011 4:36 PM
    Moderator
  • I wanted to avoid crafting 20 query interceptors but for time being, it will do. Thanks for a confirmation.
    Saturday, November 5, 2011 2:53 PM