2020
12-05
12-05
C# DataTable与Model互转的示例代码
///<summary>///实体转换辅助类///</summary>publicclassModelConvertHelper<T>whereT:new(){///<summary>///List泛型转换DataTable.///</summary>publicDataTableListToDataTable<T>(List<T>items){vartb=newDataTable(typeof(T).Name);PropertyInfo[]props=typeof(T).GetProperties(BindingFlags.Public|BindingFlags.Instance);foreach(PropertyInfopropinprops){Ty...
继续阅读 >