Guest User

Untitled

a guest
Mar 23rd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. class Program
  2. {
  3. static void Main(string[] args)
  4. {
  5. var store = DocumentStore.For("host=bla...");
  6. store.Options.UpdateBatchSize = 10;
  7.  
  8. var list = Enumerable.Range(0, 100)
  9. .Select(x => new TestClass
  10. {
  11. Id = Guid.NewGuid().ToString()
  12. })
  13. .ToList();
  14.  
  15. using(var session = store.LightweightSession())
  16. {
  17. session.DeleteWhere<TestClass>(x => x.Id != null);
  18. list.ForEach(p => session.Store(p));
  19. session.SaveChanges();
  20. }
  21.  
  22. Console.WriteLine("Done");
  23. }
  24. }
  25.  
  26. public class TestClass
  27. {
  28. public string Id { get; set; }
  29. }
Add Comment
Please, Sign In to add comment