private void AddProducts() { CreateIndex(); foreach (var product in GetProducts()) { Console.WriteLine( DocumentService.AddOrUpdate(IndexName, new Id(product.Id), product) .DebugInformation ); } }
public void UpdatingDocumentsExample() { CreateIndex(); AddProducts(); var product = DocumentService.GetById <Product>(IndexName, new Id(1)) ?? throw new ApplicationException("Продукт не найден."); SetNewValues(product); Console.WriteLine( DocumentService.AddOrUpdate(IndexName, new Id(product.Id), product) .DebugInformation ); DeleteIndex(); }