Ejemplo n.º 1
0
        public void GetTypeFromTypeName()
        {
            var ps = new List <Persion>();
            var t  = ps.GetType();

            Console.WriteLine(t);

            Console.WriteLine(t.FullName);

            var t2 = Type.GetType(t.FullName);

            Assert.AreEqual(t, t2);

            Console.WriteLine(typeof(Dictionary <string, Persion>).FullName);
            var pa1 = new Persion[0];
            var pa2 = new Persion[10];


            var t3 = Type.GetType(pa1.GetType().FullName);

            Console.WriteLine(t3.FullName);
            var t4 = Type.GetType(pa2.GetType().FullName);

            Console.WriteLine(t4.FullName);
        }
Ejemplo n.º 2
0
        public void GetTypeFromTypeName()
        {
            var ps = new List<Persion>();
            var t = ps.GetType();
            Console.WriteLine(t);

            Console.WriteLine(t.FullName);

            var t2 = Type.GetType(t.FullName);
            Assert.AreEqual(t, t2);

            Console.WriteLine(typeof(Dictionary<string, Persion>).FullName);
            var pa1 = new Persion[0];
            var pa2 = new Persion[10];


            var t3 = Type.GetType(pa1.GetType().FullName);
            Console.WriteLine(t3.FullName);
            var t4 = Type.GetType(pa2.GetType().FullName);
            Console.WriteLine(t4.FullName);
        }