Esempio n. 1
0
        private void InsertIntoStore(IStoreEvents store)
        {
            for (var x = 1; x < 100; x++)
            {
                var eC = new ItemCreatedEvent()
                {
                    AggregateId = x.ToString(),
                    Prop1       = x.ToString() + "prop1",
                    Prop2       = x.ToString() + "prop2",
                    Prop3       = x.ToString() + "prop3"
                };

                var eU = new ItemUpdatedEvent()
                {
                    AggregateId = x.ToString(),
                    Prop1       = x.ToString() + "prop1u",
                    Prop2       = x.ToString() + "prop2u",
                    Prop3       = x.ToString() + "prop3u"
                };

                using (var stream = store.OpenStream("0", eC.AggregateId, 0, int.MaxValue))
                {
                    stream.Add(new EventMessage()
                    {
                        Body = eC
                    });
                    stream.CommitChanges(Guid.NewGuid());
                    stream.Add(new EventMessage()
                    {
                        Body = eU
                    });
                    stream.CommitChanges(Guid.NewGuid());
                }
            }
        }
Esempio n. 2
0
 public void Handle(ItemUpdatedEvent @event)
 {
 }