Ejemplo n.º 1
0
        private void CreateMultiSearchTemplateDeserializer(IMultiSearchTemplateRequest request)
        {
            var formatter  = new MultiSearchResponseFormatter(request);
            var serializer = ConnectionSettings.CreateStateful(formatter);
            var creator    = new MultiSearchTemplateCreator((r, s) => serializer.Deserialize <MultiSearchResponse>(s));

            request.RequestParameters.DeserializationOverride = creator;
        }
 /// <inheritdoc />
 public IMultiSearchResponse MultiSearchTemplate(IMultiSearchTemplateRequest request) =>
 Dispatcher.Dispatch <IMultiSearchTemplateRequest, MultiSearchTemplateRequestParameters, MultiSearchResponse>(
     request,
     (p, d) =>
 {
     var converter  = CreateMultiSearchTemplateDeserializer(p);
     var serializer = ConnectionSettings.CreateStateful(converter);
     var creator    = new MultiSearchTemplateCreator((r, s) => serializer.Deserialize <MultiSearchResponse>(s));
     request.RequestParameters.DeserializationOverride = creator;
     return(LowLevelDispatch.MsearchTemplateDispatch <MultiSearchResponse>(p, new SerializableData <IMultiSearchTemplateRequest>(p)));
 }
     );
Ejemplo n.º 3
0
 /// <inheritdoc />
 public IMultiSearchResponse MultiSearchTemplate(IMultiSearchTemplateRequest request)
 {
     return(this.Dispatcher.Dispatch <IMultiSearchTemplateRequest, MultiSearchTemplateRequestParameters, MultiSearchResponse>(
                request,
                (p, d) =>
     {
         var converter = CreateMultiSearchTemplateDeserializer(p);
         var serializer = this.ConnectionSettings.StatefulSerializer(converter);
         var creator = new MultiSearchTemplateCreator((r, s) => serializer.Deserialize <MultiSearchResponse>(s));
         request.RequestParameters.DeserializationOverride(creator);
         return this.LowLevelDispatch.MsearchTemplateDispatch <MultiSearchResponse>(p, (object)p);
     }
                ));
 }
 /// <inheritdoc />
 public Task <IMultiSearchResponse> MultiSearchTemplateAsync(IMultiSearchTemplateRequest request,
                                                             CancellationToken cancellationToken = default(CancellationToken)
                                                             ) => Dispatcher.DispatchAsync <IMultiSearchTemplateRequest, MultiSearchTemplateRequestParameters, MultiSearchResponse, IMultiSearchResponse>(
     request,
     cancellationToken,
     (p, d, c) =>
 {
     var converter  = CreateMultiSearchTemplateDeserializer(p);
     var serializer = ConnectionSettings.CreateStateful(converter);
     var creator    = new MultiSearchTemplateCreator((r, s) => serializer.Deserialize <MultiSearchResponse>(s));
     request.RequestParameters.DeserializationOverride = creator;
     return(LowLevelDispatch.MsearchTemplateDispatchAsync <MultiSearchResponse>(p, new SerializableData <IMultiSearchTemplateRequest>(p), c));
 }
     );
Ejemplo n.º 5
0
 /// <inheritdoc />
 public Task <IMultiSearchResponse> MultiSearchTemplateAsync(IMultiSearchTemplateRequest request, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(this.Dispatcher.DispatchAsync <IMultiSearchTemplateRequest, MultiSearchTemplateRequestParameters, MultiSearchResponse, IMultiSearchResponse>(
                request,
                cancellationToken,
                (p, d, c) =>
     {
         var converter = CreateMultiSearchTemplateDeserializer(p);
         var serializer = this.ConnectionSettings.StatefulSerializer(converter);
         var creator = new MultiSearchTemplateCreator((r, s) => serializer.Deserialize <MultiSearchResponse>(s));
         request.RequestParameters.DeserializationOverride(creator);
         return this.LowLevelDispatch.MsearchTemplateDispatchAsync <MultiSearchResponse>(p, (object)p, c);
     }
                ));
 }