c# - The type arguments for method 'System.Linq.Queryable.SelectMany System.Linq.IQueryable -


while editing repository class error pops out

 var applicantlist = (from in context.profiles                              join app in context.applicants                                 on a.profile_id equals app.profile_id joined                               j in joined.defaultifempty()//.orderby(v => v.applicant_id)                              select j //<--  applicants type                                ).take(1000);     applicantdata = applicantlist                   .selectmany(c => c.applicants) //this line added                   .asqueryable().orderby(v => v.applicant_id).tolist();                  if (applicantdata.any())                 {                     cache.set("applicants", applicantdata, 30);                 }             }             return applicantdata; 

im having exception @

.selectmany(c => c.applicants) //this line added 

saying :

the type arguments method 'system.linq.queryable.selectmany(system.linq.iqueryable, system.linq.expressions.expression>>)' cannot inferred usage. try specifying type arguments explicitly

selectmany accepts collection of object each of them have collection property inside.

you selected applicants collection @ first statement , running selectmany on doesn't seem meaningful.

checkout these links understand selectmany better.

http://msdn.microsoft.com/en-us/library/bb534336.aspx
difference between select , selectmany


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -