Пример #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);
Пример #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);
Пример #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
                              )));
Пример #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);
Пример #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);
Пример #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));
        }
Пример #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);
Пример #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);
Пример #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)));
Пример #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);
Пример #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)));
Пример #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);
Пример #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)));
Пример #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);
Пример #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)));
Пример #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)));
Пример #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)));
Пример #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)));
Пример #23
0
 private static (T Object, bool IsValid, IGetResponse <T>) GetByIdImp <T>(this ElasticClient client, DocumentPath <T> id) where T : class
Пример #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)));
Пример #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)));
Пример #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)));