using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Dynamic;//添加引用 namespace ExpandoObject_exercise { class Program { static void Main(string[] args) { dynamic expand = new ExpandoObject(); expand.name =…
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Dynamic; namespace WindowsFormsTest { public partial…
class 动态创建数据 { //动态类型:本质感觉跟object的用法差不多,只是在执行的时候才知道数据类型 public dynamic Dynamic() { //定义一个动态类型,作为返回值 dynamic data = new ExpandoObject(); List<dynamic> list = new List<dynamic>(); dynamic model = new ExpandoObject(); model.ID = 1; model.Name = &…