Exemplo n.º 1
0
 /// <inheritdoc />
 public Task <ExistsResponse> DocumentExistsAsync <TDocument>(
     DocumentPath <TDocument> document,
     Func <DocumentExistsDescriptor <TDocument>, IDocumentExistsRequest> selector = null,
     CancellationToken ct = default
     )
     where TDocument : class =>
 DocumentExistsAsync(selector.InvokeOrDefault(new DocumentExistsDescriptor <TDocument>(document.Self.Index, document.Self.Id)), ct);
Exemplo n.º 2
0
 /// <inheritdoc/>
 public Task <IUpdateResponse <TDocument> > UpdateAsync <TDocument, TPartialDocument>(
     DocumentPath <TDocument> documentPath,
     Func <UpdateDescriptor <TDocument, TPartialDocument>, IUpdateRequest <TDocument, TPartialDocument> > selector,
     CancellationToken cancellationToken = default(CancellationToken))
     where TDocument : class
     where TPartialDocument : class =>
 this.UpdateAsync(selector?.Invoke(new UpdateDescriptor <TDocument, TPartialDocument>(documentPath)), cancellationToken);
Exemplo n.º 3
0
 /// <inheritdoc />
 public Task <TDocument> SourceAsync <TDocument>(
     DocumentPath <TDocument> document,
     Func <SourceDescriptor <TDocument>, ISourceRequest> selector = null,
     CancellationToken ct = default
     )
     where TDocument : class =>
 SourceAsync <TDocument>(selector.InvokeOrDefault(new SourceDescriptor <TDocument>(document.Self.Index, document.Self.Id)), ct);
 /// <inheritdoc />
 public ExplainResponse <TDocument> Explain <TDocument>(DocumentPath <TDocument> document,
                                                        Func <ExplainDescriptor <TDocument>, IExplainRequest <TDocument> > selector
                                                        )
     where TDocument : class =>
 Explain(selector?.Invoke(new ExplainDescriptor <TDocument>(
                              document.Document, document.Self.Index, document.Self.Id
                              )));
Exemplo n.º 5
0
 /// <inheritdoc />
 public Task <T> SourceAsync <T>(
     DocumentPath <T> document,
     Func <SourceDescriptor <T>, ISourceRequest> selector = null,
     CancellationToken cancellationToken = default(CancellationToken)
     ) where T : class =>
 SourceAsync <T>(selector.InvokeOrDefault(new SourceDescriptor <T>(document.Self.Index, document.Self.Type, document.Self.Id)),
                 cancellationToken);
Exemplo n.º 6
0
 /// <inheritdoc />
 public Task <GetResponse <TDocument> > GetAsync <TDocument>(
     DocumentPath <TDocument> document,
     Func <GetDescriptor <TDocument>, IGetRequest> selector = null,
     CancellationToken ct = default
     )
     where TDocument : class =>
 GetAsync <TDocument>(selector.InvokeOrDefault(new GetDescriptor <TDocument>(document.Document, document.Self.Index, document.Self.Id)), ct);
Exemplo n.º 7
0
        public bool Equals(DocumentPath <T> other)
        {
            IDocumentPath o = other, s = Self;

            return(s.Index.NullOrEquals(o.Index) && s.Type.NullOrEquals(o.Type) && s.Id.NullOrEquals(o.Id) &&
                   (this.Document?.Equals(other.Document) ?? true));
        }
Exemplo n.º 8
0
 /// <inheritdoc />
 public Task <UpdateResponse <TDocument> > UpdateAsync <TDocument>(
     DocumentPath <TDocument> documentPath,
     Func <UpdateDescriptor <TDocument, TDocument>, IUpdateRequest <TDocument, TDocument> > selector,
     CancellationToken cancellationToken = default
     )
     where TDocument : class =>
 UpdateAsync <TDocument, TDocument>(documentPath, selector, cancellationToken);
Exemplo n.º 9
0
 /// <inheritdoc />
 public UpdateResponse <TDocument> Update <TDocument, TPartialDocument>(DocumentPath <TDocument> documentPath,
                                                                        Func <UpdateDescriptor <TDocument, TPartialDocument>, IUpdateRequest <TDocument, TPartialDocument> > selector
                                                                        )
     where TDocument : class
     where TPartialDocument : class =>
 Update(selector?.Invoke(new UpdateDescriptor <TDocument, TPartialDocument>(
                             documentPath.Document, documentPath.Self.Index, documentPath.Self.Id
                             )));
 /// <inheritdoc />
 public Task <ExplainResponse <TDocument> > ExplainAsync <TDocument>(
     DocumentPath <TDocument> document,
     Func <ExplainDescriptor <TDocument>, IExplainRequest <TDocument> > selector,
     CancellationToken ct = default
     )
     where TDocument : class =>
 ExplainAsync(selector?.Invoke(new ExplainDescriptor <TDocument>(
                                   document.Document, document.Self.Index, document.Self.Id
                                   )), ct);
Exemplo n.º 11
0
 /// <inheritdoc />
 public ExistsResponse DocumentExists <TDocument>(DocumentPath <TDocument> document, Func <DocumentExistsDescriptor <TDocument>, IDocumentExistsRequest> selector = null)
     where TDocument : class =>
 DocumentExists(selector.InvokeOrDefault(new DocumentExistsDescriptor <TDocument>(document.Self.Index, document.Self.Id)));
Exemplo n.º 12
0
 /// <inheritdoc />
 public Task <IGetResponse <T> > GetAsync <T>(
     DocumentPath <T> document,
     Func <GetDescriptor <T>, IGetRequest> selector = null,
     CancellationToken cancellationToken            = default(CancellationToken)
     ) where T : class => GetAsync <T>(selector.InvokeOrDefault(new GetDescriptor <T>(document)), cancellationToken);
Exemplo n.º 13
0
 /// <inheritdoc/>
 public IExplainResponse <TDocument> Explain <TDocument>(DocumentPath <TDocument> document, Func <ExplainDescriptor <TDocument>, IExplainRequest <TDocument> > selector)
     where TDocument : class =>
 this.Explain <TDocument>(selector?.Invoke(new ExplainDescriptor <TDocument>(document)));
Exemplo n.º 14
0
 /// <inheritdoc/>
 public Task <IExistsResponse> DocumentExistsAsync <T>(DocumentPath <T> document, Func <DocumentExistsDescriptor <T>, IDocumentExistsRequest> selector = null) where T : class =>
 this.DocumentExistsAsync(selector.InvokeOrDefault(new DocumentExistsDescriptor <T>(document.Self.Index, document.Self.Type, document.Self.Id)));
 /// <inheritdoc/>
 public Task <IDeleteResponse> DeleteAsync <T>(
     DocumentPath <T> document, Func <DeleteDescriptor <T>, IDeleteRequest> selector = null,
     CancellationToken cancellationToken = default(CancellationToken)
     ) where T : class => this.DeleteAsync(selector.InvokeOrDefault(new DeleteDescriptor <T>(document.Self.Index, document.Self.Type, document.Self.Id)), cancellationToken);
Exemplo n.º 16
0
 /// <inheritdoc/>
 public Task <IExplainResponse <T> > ExplainAsync <T>(DocumentPath <T> document, Func <ExplainDescriptor <T>, IExplainRequest <T> > selector)
     where T : class =>
 this.ExplainAsync <T>(selector?.Invoke(new ExplainDescriptor <T>(document.Self.Index, document.Self.Type, document.Self.Id)));
Exemplo n.º 17
0
 /// <inheritdoc/>
 public Task <IUpdateResponse> UpdateAsync <TDocument>(DocumentPath <TDocument> documentPath, Func <UpdateDescriptor <TDocument, TDocument>, IUpdateRequest <TDocument, TDocument> > selector)
     where TDocument : class =>
 this.UpdateAsync <TDocument, TDocument>(documentPath, selector);
Exemplo n.º 18
0
 /// <inheritdoc/>
 public Task <IGetResponse <T> > GetAsync <T>(DocumentPath <T> document, Func <GetDescriptor <T>, IGetRequest> selector = null) where T : class =>
 this.GetAsync <T>(selector.InvokeOrDefault(new GetDescriptor <T>(document)));
Exemplo n.º 19
0
 /// <inheritdoc />
 public DeleteResponse Delete <TDocument>(DocumentPath <TDocument> document, Func <DeleteDescriptor <TDocument>, IDeleteRequest> selector = null) where TDocument : class =>
 Delete(selector.InvokeOrDefault(new DeleteDescriptor <TDocument>(document.Self.Index, document.Self.Id)));
Exemplo n.º 20
0
 /// <inheritdoc />
 public UpdateResponse <TDocument> Update <TDocument>(DocumentPath <TDocument> documentPath,
                                                      Func <UpdateDescriptor <TDocument, TDocument>, IUpdateRequest <TDocument, TDocument> > selector
                                                      ) where TDocument : class =>
 Update <TDocument, TDocument>(documentPath, selector);
 /// <inheritdoc/>
 public IExistsResponse SourceExists <T>(DocumentPath <T> document, Func <SourceExistsDescriptor <T>, ISourceExistsRequest> selector = null) where T : class =>
 this.SourceExists(selector.InvokeOrDefault(new SourceExistsDescriptor <T>(document.Self.Index, document.Self.Type, document.Self.Id)));
Exemplo n.º 22
0
 /// <inheritdoc />
 public T Source <T>(DocumentPath <T> document, Func <SourceDescriptor <T>, ISourceRequest> selector = null) where T : class =>
 Source <T>(selector.InvokeOrDefault(new SourceDescriptor <T>(document.Self.Index, document.Self.Type, document.Self.Id)));
Exemplo n.º 23
0
 private static (T Object, bool IsValid, IGetResponse <T>) GetByIdImp <T>(this ElasticClient client, DocumentPath <T> id) where T : class
Exemplo n.º 24
0
 /// <inheritdoc/>
 public Task <IExplainResponse <TDocument> > ExplainAsync <TDocument>(DocumentPath <TDocument> document, Func <ExplainDescriptor <TDocument>, IExplainRequest <TDocument> > selector, CancellationToken cancellationToken = default(CancellationToken))
     where TDocument : class =>
 this.ExplainAsync <TDocument>(selector?.Invoke(new ExplainDescriptor <TDocument>(document.Self.Index, document.Self.Type, document.Self.Id)), cancellationToken);
 /// <inheritdoc/>
 public IDeleteResponse Delete <T>(DocumentPath <T> document, Func <DeleteDescriptor <T>, IDeleteRequest> selector = null) where T : class =>
 this.Delete(selector.InvokeOrDefault(new DeleteDescriptor <T>(document.Self.Index, document.Self.Type, document.Self.Id)));
Exemplo n.º 26
0
 /// <inheritdoc/>
 public Task <IUpdateResponse> UpdateAsync <TDocument, TPartialDocument>(DocumentPath <TDocument> documentPath, Func <UpdateDescriptor <TDocument, TPartialDocument>, IUpdateRequest <TDocument, TPartialDocument> > selector)
     where TDocument : class
     where TPartialDocument : class =>
 this.UpdateAsync(selector?.Invoke(new UpdateDescriptor <TDocument, TPartialDocument>(documentPath)));
Exemplo n.º 27
0
 /// <inheritdoc />
 public GetResponse <TDocument> Get <TDocument>(DocumentPath <TDocument> document, Func <GetDescriptor <TDocument>, IGetRequest> selector = null)
     where TDocument : class =>
 Get <TDocument>(selector.InvokeOrDefault(new GetDescriptor <TDocument>(document.Document, document.Self.Index, document.Self.Id)));