private JsonConverter CreateCovariantSearchSelector <T, TResult>(ISearchTemplateRequest originalSearchDescriptor)
     where T : class
     where TResult : class
 {
     CovariantSearch.CloseOverAutomagicCovariantResultSelector(this.Infer, originalSearchDescriptor);
     return(originalSearchDescriptor.TypeSelector == null ? null : new ConcreteTypeConverter <TResult>(originalSearchDescriptor.TypeSelector));
 }
 private Func <IApiCallDetails, Stream, SearchResponse <TResult> > CreateSearchDeserializer <T, TResult>(ISearchRequest request)
     where T : class
     where TResult : class
 {
     CovariantSearch.CloseOverAutomagicCovariantResultSelector(this.Infer, request);
     if (request.TypeSelector == null)
     {
         return(null);
     }
     return((r, s) => this.FieldsSearchDeserializer <T, TResult>(r, s, request));
 }
示例#3
0
        private JsonConverter CreateMultiSearchTemplateDeserializer(IMultiSearchTemplateRequest request)
        {
            if (request.Operations != null)
            {
                foreach (var operation in request.Operations.Values)
                {
                    CovariantSearch.CloseOverAutomagicCovariantResultSelector(this.Infer, operation);
                }
            }

            return(new MultiSearchResponseJsonConverter(this.ConnectionSettings, request));
        }