public void STORE_NEW_EVENTS_ON_EXISTSING_DOCUMENT() { MongoEventStore store = new MongoEventStore(client); Events.SampleEvent _event = new Events.SampleEvent { Message = "Test", id = id }; IList<IEvent> events = new List<IEvent>(); events.Add(_event); store.AppendToStream(id, 1, events); Events.SampleEvent _event2 = new Events.SampleEvent { Message = "Test 2", id = id }; IList<IEvent> events2 = new List<IEvent>(); events2.Add(_event2); store.AppendToStream(id, 2, events2); }
public void INSERT_THOUSAND_EVENTS() { MongoEventStore store = new MongoEventStore(client); client.GetServer().GetDatabase("EventStore").Drop(); Enumerable. Range(1, 1000). ToList(). ForEach(i => { var newid = new Events.SampleID(i); Events.SampleEvent _event = new Events.SampleEvent { Message = "Test", id = newid }; IList<IEvent> events = new List<IEvent>(); events.Add(_event); store.AppendToStream(newid, 1, events); }); }