Exemplo n.º 1
0
        void DoBinarySerializedEvents()
        {
            var json = new BinarySampleRuntime(CONNECTION_STRING);

            json.Start();

            var id = Guid.NewGuid();

            var serializer = new BinaryDomainEventSerializer();

            var obj = serializer.Serialize(new FooCreatedEvent());



            var root = new FooRoot();

            root.CreateMe(id);

            var repo = json.ServiceLocator.Resolve <IDomainRepository>();

            repo.Save(root);

            var newRoot = repo.GetById <FooRoot>(id);

            Console.WriteLine(String.Format("Id : {0}, Type : {1}", newRoot.Id, newRoot.GetType()));

            json.Shutdown();
        }
Exemplo n.º 2
0
        void DoJsonSerializedEvents()
        {
            var json = new JsonSampleRuntime();

            json.Start();

            var id = Guid.NewGuid();

            var root = new FooRoot();

            root.CreateMe(id);
            var repo = json.ServiceLocator.Resolve <IDomainRepository>();

            repo.Save(root);

            var newRoot = repo.GetById <FooRoot>(id);

            Console.WriteLine(String.Format("Id : {0}, Type : {1}", newRoot.Id, newRoot.GetType()));
            json.Shutdown();
        }