public void NestedClassShouldBeAbleToGetValue() { var pocoData = new PocoDataFactory(new MapperCollection()).ForType(typeof(ComplexMap)); var obj = new ComplexMap() { Name = "Bill", NestedComplexMap = new NestedComplexMap() { Id = 9 } }; var val = pocoData.Columns["NestedComplexMap__Id"].GetValue(obj); Assert.AreEqual(9, val); }
public void ProjectToComplexColumn() { var obj = new ComplexMap() { Name = "Bill", NestedComplexMap2 = new NestedComplexMap2() { Id = 9, Name = "Silly" } }; Database.Insert(obj); var results = Database.Query <ComplexMap>().ProjectTo(x => x.NestedComplexMap2).Single(); Assert.AreEqual(obj.NestedComplexMap2.Id, results.Id); Assert.AreEqual(obj.NestedComplexMap2.Name, results.Name); }
public void Test1() { var obj = new ComplexMap() { Name = "Bill", NestedComplexMap = new NestedComplexMap() { Id = 9, NestedComplexMap2 = new NestedComplexMap2() { Id = 18 } } }; Database.Insert(obj); var results = Database.Fetch <ComplexMap>().Single(); Assert.AreEqual(obj.Id, results.Id); Assert.AreEqual(obj.Name, results.Name); Assert.AreEqual(obj.NestedComplexMap.Id, results.NestedComplexMap.Id); Assert.AreEqual(obj.NestedComplexMap.NestedComplexMap2.Id, results.NestedComplexMap.NestedComplexMap2.Id); }
public void Test1() { var obj = new ComplexMap() { Name = "Bill", NestedComplexMap = new NestedComplexMap() { Id = 9, NestedComplexMap2 = new NestedComplexMap2() { Id = 18 } } }; Database.Insert(obj); var results = Database.Fetch<ComplexMap>().Single(); Assert.AreEqual(obj.Id, results.Id); Assert.AreEqual(obj.Name, results.Name); Assert.AreEqual(obj.NestedComplexMap.Id, results.NestedComplexMap.Id); Assert.AreEqual(obj.NestedComplexMap.NestedComplexMap2.Id, results.NestedComplexMap.NestedComplexMap2.Id); }
public void ProjectToComplexColumn() { var obj = new ComplexMap() { Name = "Bill", NestedComplexMap2 = new NestedComplexMap2() { Id = 9, Name = "Silly" } }; Database.Insert(obj); var results = Database.Query<ComplexMap>().ProjectTo(x => x.NestedComplexMap2).Single(); Assert.AreEqual(obj.NestedComplexMap2.Id, results.Id); Assert.AreEqual(obj.NestedComplexMap2.Name, results.Name); }