Result interceptors

Feature

Intercept results of SOLR before parse in POCO

How to

  1. Create a class that implements IResultInterceptor

    public class MyInterceptor : IResultInterceptor
    {
        public void Execute(string requestHandler, ref string json) // method from interface
        {
            // some code
        }
    }
  1. Add instance using method Add in DocumentCollection<>

    var myInterceptor = new MyInterceptor();

    DocumentSearch<TechProduct> documentSearch; // From your DI provider
    documentSearch
        .Add(myInterceptor)
        // ...  Other settings
        .Execute();

Last updated