码迷,mamicode.com
首页 > 其他好文 > 详细

datatable list 之前相互转换

时间:2016-11-02 00:28:43      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:using   this   str   for   res   get   nuget   ast   git   

使用 FastMember:

IEnumerable<SomeType> data = ... DataTable table = new DataTable(); using(var reader = ObjectReader.Create(data)) { table.Load(reader); }

This uses the FastMember‘s meta-programming API for maximum performance. If you want to restrict it to particular members (or enforce the order), then you can do that too:

IEnumerable<SomeType> data = ...
DataTable table = new DataTable();
using(var reader = ObjectReader.Create(data, "Id", "Name", "Description")) {
    table.Load(reader);
}

使用类库:
https://github.com/mgravell/fast-member

datatable list 之前相互转换

标签:using   this   str   for   res   get   nuget   ast   git   

原文地址:http://www.cnblogs.com/zeroone/p/6021113.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!