asp.net - Linq to Entities does not recognize the method collection Dictionary -


i have model named emaildetailmodel dictionary field.

my query is:

var query = email in context.emailmodel             rolesforuser.contains(email.groupname)             orderby email.id descending             select new emaildetailmodel()              {                 = email.from,                 id = email.id,                 message = email.body,                 subject = email.subject,                 pathfilename =                        (from pdf in context.pdfmodel                         pdf.email_id == email.id                         select pdf)                     .todictionary(k => k.pathfile, v => v.filename),                 timesend = email.activetime}; 

however error occurs on line when trying send list view:

view(query.topagedlist(pagenumber, pagesize)); 

saying that:

linq entities not recognize method 'system.collections.generic.dictionary

if me, i'm not sure how can pass key , value pathfilename dictionary.

the issue there no sql conversion of dictionary generation linq entities can understand.

i have struggled similar error messages whenever linq cannot translated sql statement.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -