locked
Untyped DSP and QueryInterceptors RRS feed

  • Question

  • How to write QueryInterceptors for untyped Entity ?

    I tired the very generic, Object sigunature and it didn't work

            [QueryInterceptor("Products")]
            public Expression<Func<objectbool>> OnPostQuery()
            {
            }
    Tuesday, December 13, 2011 8:11 PM

Answers

  • Okay I looked the Untyped DSP implemention , you can use use the following signature to intercept untyped Entity with just some simple filter expression. Samthing applies for ChangeInterceptor also.

     

            [QueryInterceptor("Products")]
            public Expression<Func<DSPResourcebool>> OnPostQuery()
            {
                return p => p.GetValue("Name").ToString() == "Wine";
     
            }
    • Marked as answer by WCFDataService Tuesday, December 13, 2011 8:44 PM
    Tuesday, December 13, 2011 8:25 PM