List<Object> 使用Linq
2016-07-18 17:03
344 查看
List<Asset> bdList = allAsset.Where(m => m.Owner.Depts == view.DeptName).ToList(); var query = from item in bdList group item by new { mainName = item.MainCategory.Name, subName = item.SubCategory.Name, assetName = item.Name, stateName = item.State.Name } into gp select new { MainCategory = gp.First().MainCategory.Name, SubCategory = gp.First().SubCategory.Name, AssetName = gp.First().Name, StateName = gp.First().State.Name, CostTotal = gp.Sum(m => m.Cost) };
相关文章推荐
- xmpp配置服务器
- Objective-C Category 的实现原理
- Swift比Objective-C有什么优势
- @weakify和@strongify
- JavaScript Object.defineProperty()方法详解
- ObjectDataSource.ObjectCreating 事件
- 最新的App上架教程Object-C
- 最新的App上架教程Object-C
- JsonObject 解析 json
- RMI 之 简单的 HelloWorld 实现(三)
- 简谈Masnory的功能和使用
- Objective-C Fast Enumeration 实现原理
- Object::connect函数的学习
- 多线程(3)-基于Object的线程等待与唤醒
- Object类中的toString(),equals(), hashCode()方法之间的关系
- Objective-c中.m、.h、.mm文件
- Xcode中pch文件的使用
- AttributeError: 'module' object has no attribute 'XXX'
- 解决aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: Nosuchfile
- The method list(String, Object[]) is ambiguous for the type BaseHibernateDao<M,PK