Ejemplo n.º 1
0
        public static void TinyMapperTest()
        {
            TinyMapper.Bind <Park, Park>();

            var b1 = new Building();
            var b2 = TinyMapper.Map <Building>(b1);

            var p1 = Park.Create();
            var p2 = TinyMapper.Map <Park>(p1);//p2.Cars.Count = 0 is unexpected.Collection element does not copied to property with private setter.

            var d = new Dictionary <String, String>();

            d["Name"] = "B1";
            var b3 = TinyMapper.Map <Building>(d);//Does not map...

            return;

            //StackOverflowException thrown
            TinyMapper.Bind <TreeNode, TreeNode>();
            TinyMapper.Bind <TreeNode, TreeNodeTarget>();

            var tn  = TreeNode.Create();
            var tn2 = TinyMapper.Map <TreeNode>(tn);
        }
Ejemplo n.º 2
0
 public Building()
 {
     this.Name = "Building123";
     this.Park = Park.Create();
 }