Exemple #1
0
        public override void Run()
        {
            Weapon w = new Weapon()
            {
                Name        = "Best Weapon",
                Attachments = new List <Attachment>()
                {
                    new Attachment()
                    {
                        Name = "Attach1"
                    },
                    new Attachment()
                    {
                        Name = "Attach2"
                    }
                }
            };

            Console.WriteLine("Loading persistence directory...");
            EntityPersistence p = new EntityPersistence("Database");

            Console.WriteLine("Writing entity with special subclass");
            var id = p.WriteEntity <Weapon> (w);

            Console.WriteLine("Reading entity with special subclass");
            Weapon read = p.RetrieveEntity <Weapon>(id);
        }
Exemple #2
0
        public override void Run ()
        {
            Weapon w = new Weapon () 
            {
                Name = "Best Weapon",
                Attachments = new List<Attachment>()
                {
                    new Attachment()
                    {
                        Name = "Attach1"
                    },
                    new Attachment()
                    {
                        Name = "Attach2"
                    }
                }
            };

            Console.WriteLine("Loading persistence directory...");
            EntityPersistence p = new EntityPersistence ("Database");

            Console.WriteLine("Writing entity with special subclass");
            var id = p.WriteEntity<Weapon> (w);

            Console.WriteLine("Reading entity with special subclass");
            Weapon read = p.RetrieveEntity<Weapon>(id);
        }
Exemple #3
0
        public override void Run ()
        {
            Player p = new Player () {
                Name = "MsgPackPlayer"
            };
                    
            Console.WriteLine ("Creating persistence directory...");
            EntityPersistence m = new EntityPersistence ("Database");
            Console.WriteLine ("Writing model");
            Guid id = m.WriteEntity (p);

            Console.WriteLine ("Reading model");
            m.RetrieveEntity<Player> (id);

            Console.WriteLine ("Reading nonexistent model");
            m.RetrieveEntity<Player>(Guid.NewGuid());
        }
Exemple #4
0
        public override void Run()
        {
            Player p = new Player()
            {
                Name = "MsgPackPlayer"
            };

            Console.WriteLine("Creating persistence directory...");
            EntityPersistence m = new EntityPersistence("Database");

            Console.WriteLine("Writing model");
            Guid id = m.WriteEntity(p);

            Console.WriteLine("Reading model");
            m.RetrieveEntity <Player> (id);

            Console.WriteLine("Reading nonexistent model");
            m.RetrieveEntity <Player>(Guid.NewGuid());
        }
Exemple #5
0
        public override void Run()
        {
            base.Run();

            Console.WriteLine("Loading persistence directory...");
            EntityPersistence p = new EntityPersistence("Database");

            Console.WriteLine("Writing versioned class...");
            var x = p.WriteEntity<ChangedClass>(new ChangedClass()
            {
                Id = new Guid(_fixedGuid),
                Name1 = "other version!"
            });

            Console.WriteLine("Reading versioned class...");
            var ent = p.RetrieveEntity<ChangedClass>(new Guid(_fixedGuid));
        }
Exemple #6
0
        public override void Run()
        {
            base.Run();

            Console.WriteLine("Loading persistence directory...");
            EntityPersistence p = new EntityPersistence("Database");

            Console.WriteLine("Writing versioned class...");
            var x = p.WriteEntity <ChangedClass>(new ChangedClass()
            {
                Id    = new Guid(_fixedGuid),
                Name1 = "other version!"
            });

            Console.WriteLine("Reading versioned class...");
            var ent = p.RetrieveEntity <ChangedClass>(new Guid(_fixedGuid));
        }