10.实体类(POJO)参数的赋值(form表单)原理 10.1.原理解析 测试用例 准备好两个实体类 public class Person { private String name; private Integer age; private Pet pet; } public class Pet { private String name; private Integer age; } html的form表单 注意这个 宠物Pet对象的name不能乱写 必须要和 person中定义的名称一
using System; using System.Collections.Generic; using System.Data; using System.Reflection; /// <summary> /// 将DataTable数据源转换成实体类 /// </summary> /// <typeparam name="T">实体</typeparam> public static class ToModel<T>