摘要:
This code sample demonstrates how to copy class properties from one class to another even if they are not the same type. It also demonstrates how to validate a class's required properties dynamically. Both of these can increase your coding productivity especially when dealing with web service versions of your business classes. 阅读全文
摘要:
基本思路
利用反射机制将DataTable的字段与自定义类型的公开属性互相赋值。注意:从DataSet到IList的转换,自定义类型的公开属性必须与DataTable中的字段名称一致,才能到达想要的结果。建议DataTable的定义从数据库来,自定义类型用O/R Mapping的方式获得。
阅读全文