Any way to programmatically add a QueryInterceptor? RRS feed

  • Question

  • I'm trying to create a custom host factory derived from ServiceHostFactoryBase that via url inspection and reflection, creates and returns the appropriate instance of FeedBase<BirthEntities>, where BirthEntities is one of my EF models and FeedBase is defined as so:

    public class FeedBase<T> : DataService<T> where T: ObjectContext

    I have all the information I need to create the instance, but I need to have a QueryInterceptor added to do some security filtering.

    Is there anyway to add an interceptor programmatically?  i thought if using the codedom to gen a my class with the appropriate attribute, but I'd like to avoid that if possible.

    My end goal is to be able to deploy new WCF data services in my app by simply dropping the DLL with the EF model in the bin folder, adding a new .svc file and configure some metadata without having to do a recompile and deploy of my app.


    Friday, January 21, 2011 10:57 PM


All replies