Custom query in EFDAL GetPagedResults

Jun 7, 2011 at 8:32 AM
Edited Jun 7, 2011 at 8:34 AM

 

Hi,
Can't I use custom query with EFDAL GetPagedResults? Or how can I accomplish the paging with custom queries?
The query in the snippet below doesn't work. It says,'Expression cannot contain lambda expressions'.

 private void Populate()
    {

        using (var context = new EvrakEntities())
        {
            var url = new PagingURL(this.Request.Url.AbsoluteUri);
            var paging = new Widgetsphere.EFCore.DataAccess.Paging(url.PageOffset, url.RecordsPerPage);
            gridViewEvrakListesi.DataSource = context.EvrakListesi.GetPagedResults(x => x.BirimPk==UsrBirimPk, paging);
            gridViewEvrakListesi.DataBind();
            PagingControl.Populate(paging);
        }
    }


Thanks in advance..
Inanc
Jun 7, 2011 at 8:46 AM

Ok,

I am sorry I should have been check the method overloads.

gridViewEvrakListesi.DataSource = context.EvrakListesi.GetPagedResults(x => x.BirimPk == UsrBirimPk, x => x.Pk, paging);

works exactly how I want.

Thanks.

Inanc

Coordinator
Jun 7, 2011 at 11:25 AM

Great. We think this is a great convenience method to perform paging with minimal code.