将Linq(EF)级联查询的结果转换为泛型集合类型

 var result = (from a in result
                          join b in _customerInvestmentRepository.Table on a.CustomerInvestmentId equals b.Id
                          where b.InvestmentStatus == investmentStatus
                          select a
                             );

 

List<InvestmentDividendModel> list = result.Select(t => new InvestmentDividendModel() { CreateWhen=t.CreateWhen, InvestmentNumber=t.InvestmentNumber, Amount=t.Amount }).ToList();

posted @ 2016-10-15 17:04  z_hj  阅读(1827)  评论(0编辑  收藏  举报