dynamic类型

dynamic类型在运行时做类型检查
可用于变量类型、方法参数和返回值类型
示例
dynamic person = new Student { Name = "张三", Age = 20 };
 
dynamic ViewBag{get ;set;}
 
dynamic d = new System.Dynamic.ExpandoObject();
d.Success = error ? "false" : "true";
d.Msg = msg;
d.Data = data;
return d;
posted @ 2017-06-20 14:36  码大坑  阅读(181)  评论(0编辑  收藏  举报