linq - "Cannot Convert Lambda Expression to Delegate type" Error in RavenDB query -
i have ravendb document looks this:
{ "parentid": null, "order": 10, "url": "/sandbox", "rows": [ { "instanceid": "2771a0d7-7f3f-4854-a3ba-27f25f88a45e", "cssclass": null, "columns": [ { "instanceid": "b91495f5-b770-4da7-8073-ad3bd8221ca8", "cssclass": null, "span": 3, "cmsmoduleinstancesettings": [ { "$type": "modulehtml.models.modulehtmlinstancesettings, modulehtml", "isactive": false, "showauthor": false, "showdate": false, "showcommentscount": false, "showlast2comments": false, "cmsmoduleinstanceid": 417, "containerclass": "default", "moduletype": "modulehtml", "displaytype": "summary" }, { "$type": "modulehtml.models.modulehtmlinstancesettings, modulehtml", "isactive": false, "showauthor": false, "showdate": false, "showcommentscount": false, "showlast2comments": false, "cmsmoduleinstanceid": 545, "containerclass": "default", "moduletype": "modulehtml", "displaytype": "summary" } ], "id": 0, "name": null, "createdon": "0001-01-01t00:00:00.0000000", "createdby": 0, "lastmodifiedon": "0001-01-01t00:00:00.0000000", "lastmodifiedby": 0 }, ... ], ... }, ... ], ... } and want retrieve page document , include rows, columns , cmsmoduleinstancesettings active.
i have tried:
var page = documentsession.query<cmspage>() .singleordefault(p => p.id == pageid) .rows .any(x => x.columns .any(z => z.cmsmoduleinstancesettings .where(m => m.isactive == true))); but returns :
error 1 cannot convert lambda expression delegate type 'system.func<cms.models.cmscolumn,bool>' because of return types in block not implicitly convertible delegate return type what doing wrong?
you aware doing query in memory filter, right?
split this:
var page = documentsession.query<cmspage>() .singleordefault(p => p.id == pageid); and:
var rows = page.rows .any(x => x.columns .any(z => z.cmsmoduleinstancesettings .where(m => m.isactive == true))); where error now?
Comments
Post a Comment