예제 #1
0
 public static ValueTask <Exception> CreateAsync <T>(
     this IElasticSearchRepository <T> @this,
     string index,
     Func <T, Guid> idSelector,
     IEnumerable <T> documents,
     bool replace = false,
     CancellationToken cancellationToken = default) where T : class, new()
 {
     return(@this.CreateAsync(
                index,
                (T model) => idSelector?.Invoke(model).ToString(),
                documents,
                replace,
                cancellationToken));
 }
예제 #2
0
 public static ValueTask <bool> CreateAsync <T>(
     this IElasticSearchRepository <T> @this,
     string index, Guid id, T item, CancellationToken cancellationToken = default) where T : class, new()
 {
     return(@this.CreateAsync(index, id.ToString(), item, cancellationToken));
 }