本文介绍了该类型参数的方法“System.Linq.Queryable.SelectMany System.Linq.IQueryable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在编辑我的仓库类错误弹出

  VAR applicantList =(来自于context.Profiles
                             加入context.APPLICANTs应用
                                在a.PROFILE_ID等于app.Profile_id成加盟
                              从joined.DefaultIfEmpty()Ĵ//排序依据(V => v.APPLICANT_ID)。
                             选择j可//< - 这是申请者键入
                               )。取(1000);   applicantdata = applicantList
                  .SelectMany(C => c.APPLICANTs)//这一行加
                  。.AsQueryable()的OrderBy(V => v.APPLICANT_ID).ToList();                如果(applicantdata.Any())
                {
                    Cache.Set(申请人,applicantdata,30);
                }
            }
            返回applicantdata;

林具有

异常

  .SelectMany(C => c.APPLICANTs)//这一行加

说:

解决方案

SelectMany accepts a collection of object which each of them have a collection property inside.

You selected APPLICANTs collection at the first statement and running a SelectMany on it doesn't seem to be meaningful.

Checkout these links to understand the SelectMany better.

http://msdn.microsoft.com/en-us/library/bb534336.aspx
Difference Between Select and SelectMany

这篇关于该类型参数的方法“System.Linq.Queryable.SelectMany System.Linq.IQueryable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 17:04