public IEnumerable LoadResourceList(string query, int start, int pageSize)
{
string errMsg;
Dictionary<T_System_DocumentResource, string> resWithIcon = new Dictionary<T_System_DocumentResource, string>();
List<T_System_DocumentResource> resList = bll.LoadResourceList(query, out errMsg, start, pageSize);
var aa = from res in resList
select new
{
Icon = FileUtil.GetIcon(res.Extension)//动态添加,javascript可直接调用
,
res.ResourceID
,
res.ResourceType
,
res.Title
,
res.Size
,
res.PublishDate
,
res.Extension
};
return aa;
}
{
string errMsg;
Dictionary<T_System_DocumentResource, string> resWithIcon = new Dictionary<T_System_DocumentResource, string>();
List<T_System_DocumentResource> resList = bll.LoadResourceList(query, out errMsg, start, pageSize);
var aa = from res in resList
select new
{
Icon = FileUtil.GetIcon(res.Extension)//动态添加,javascript可直接调用
,
res.ResourceID
,
res.ResourceType
,
res.Title
,
res.Size
,
res.PublishDate
,
res.Extension
};
return aa;
}
本文介绍了一段使用C#编写的代码,该代码通过LINQ查询从资源业务逻辑层加载资源列表,并为每个资源动态添加图标路径。具体包括了如何创建资源列表、加载资源并设置多种属性。
1421

被折叠的 条评论
为什么被折叠?



