private static void AppendPrefixAndAddId(HelloWorldAddedEvent helloWorldAddedEvent) { var prefix = Random.Next(0, 2) == 0 ? "Mr" : "Mrs"; helloWorldAddedEvent.Name = $"{prefix} {helloWorldAddedEvent.Name}"; helloWorldAddedEvent.Id = Guid.NewGuid().ToString(); }
private static void SaveToRaven(HelloWorldAddedEvent helloWorldAddedEvent, IDocumentStore documentStore) { using (IDocumentSession session = documentStore.OpenSession()) { session.Store(helloWorldAddedEvent); session.SaveChanges(); } }