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); }
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()); }
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); }
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); }
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; }