【发布时间】:2013-03-01 06:27:28
【问题描述】:
我创建了以下anonymous type:
int group_id = 0;
int dep_code = 0;
int dep_year = 0;
string dep_name = string.Empty;
int boss_num = 0;
string boss_name = string.Empty;
var list = new { group_id = group_id, dep_code = dep_code, dep_year = dep_year, dep_name = dep_name, boss_num = boss_num, boss_name = boss_name };
如何转换成IListSource, IEnumerable, or IDataSource.??
【问题讨论】:
-
那么你希望它是什么序列?单个值?
-
这将是我的
formview的数据源 -
为什么要保留数据源
anonymous?只需声明一个类 - 继承您的代码的开发人员可能知道您住在哪里;-)
标签: c# linq .net-3.5 ienumerable anonymous-types