Ejemplo n.º 1
0
        public Person SaveTest()
        {
            Person person = new Person {
                FirstName = "Sony", LastName = "Arouje"
            };
            NodeMapper mapper = new NodeMapper();

            person = mapper.Save <Person>(person);
            Console.WriteLine("Generated Id: " + person.Id.ToString());
            Assert.AreNotEqual(0, person.Id);
            return(person);
        }
        public void SaveOrder()
        {
            Order order = new Order();
            order.Id = 0;
            order.Name = "Viji";
            order.AddOrderItem(new OrderItem(0, new Product(0, "Rice")));
            order.AddOrderItem(new OrderItem(0, new Product(0, "Sugar")));

            NodeMapper nodeMapper = new NodeMapper();
            nodeMapper.Save<Order>(order);
            Console.WriteLine(order.Id.ToString());
            Assert.AreNotEqual(0, order.Id);
        }
Ejemplo n.º 3
0
        public void SaveEntity()
        {
            MyClass claz    = new MyClass();
            Manager manager = new Manager {
                OfficeName = "Neo4jD"
            };

            claz.SelectedPerson = manager;
            NodeMapper nodeMapper = new NodeMapper();
            MyClass    savedClass = nodeMapper.Save <MyClass>(claz);

            Assert.AreNotEqual(0, savedClass.Id);
            Console.WriteLine(savedClass.Id.ToString());
        }
Ejemplo n.º 4
0
        public void SaveOrder()
        {
            Order order = new Order();

            order.Id   = 0;
            order.Name = "Viji";
            order.AddOrderItem(new OrderItem(0, new Product(0, "Rice")));
            order.AddOrderItem(new OrderItem(0, new Product(0, "Sugar")));

            NodeMapper nodeMapper = new NodeMapper();

            nodeMapper.Save <Order>(order);
            Console.WriteLine(order.Id.ToString());
            Assert.AreNotEqual(0, order.Id);
        }
Ejemplo n.º 5
0
        public void Get_MyClassEntity_And_Update_Manager()
        {
            NodeMapper nodeMapper = new NodeMapper();
            MyClass    myClaz     = nodeMapper.Get <MyClass>(29);

            Console.WriteLine("Get_MyClassEntity_And_Update_Manager: " + myClaz.GetType().ToString());
            Manager manager = (Manager)myClaz.SelectedPerson;

            manager.OfficeName    = "Product Development";
            myClaz.SelectedPerson = manager;
            nodeMapper.Save <MyClass>(myClaz);


            MyClass myClazTmp  = nodeMapper.Get <MyClass>(29);
            Manager managerTmp = (Manager)myClaz.SelectedPerson;

            Assert.AreEqual("Product Development", manager.OfficeName);
        }
Ejemplo n.º 6
0
 public Person SaveTest()
 {
     Person person = new Person { FirstName = "Sony", LastName="Arouje" };
     NodeMapper mapper = new NodeMapper();
     person=mapper.Save<Person>(person);
     Console.WriteLine("Generated Id: " + person.Id.ToString());
     Assert.AreNotEqual(0, person.Id);
     return person;
 }