ExposedObject可以将一个对象快速封装未一个dynamic

using System;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            object obj3 = new { name = "cys" };
            //Console.WriteLine(obj3.name);  报错

            var aa = ExposedObject.Exposed.From(obj3);//ExposedObject通过Nuget获取
            Console.WriteLine(aa.name);
        }
    }

}

 

posted on 2018-02-24 13:25  chester·chen  阅读(243)  评论(0编辑  收藏  举报