• http://twitter.com/BenHoltsclaw Ben Holtsclaw

    How would you work a multi-poco query into that sample? I haven’t seen anything showing how to do paging with multi-poco.

    • http://twitter.com/iToddWood Todd A. Wood

      What is an example of a multi-poco result that you are thinking of that would be represented in a grid?

      The typical PetaPoco usage returns a single POCO and the PetaPoco Fetch() feature to combine 1:M and M:M does not work with the Page() feature that I am aware. If you can define a SQL query for the grid row then a combined View Model POCO to support it is an option. 

  • Pingback: PetaPoco Custom SQL Paging | Implement IToddWood

  • Kevin Jensen

    Nice work here…

    • http://www.woodcp.com/ Todd A. Wood

      Thank you Kevin.

  • Matt Pontel

    Great write up – This should really take off!
    I’m trying to implement it myself but coming across an issue where my DataTablesPageRequest pageRequest

    isn’t being populated when it makes it’s first request for data at my controller.  Was this something you came across ? 

    • http://www.woodcp.com/ Todd A. Wood

      Thanks Matt,

      I did not encounter any issues similar to that scenario. Is the first callback to the controller coming through as null? I would first check the Chrome console for js errors, XHR network request for what was posted and the response if any, and then the Model Binding C# method if it’s clear the post is sending JSON and functioning.

      I am glad you find this useful.

      • Matt Pontel

         I can see in Firebug the proper request being made by the javsscript but if I catch the pageRequest when it hits the controller all the fields are null/0.

        Just thought perhaps there was something quirky that perhaps was missing.  I’ll keep having a hunt through.

        Obviously, with no columns being specified, I’m getting null errors in the data access class when it tried to sort the data.

      • Matt Pontel

        The problem ended up being me forgetting to add to Globals.asax

                protected void Application_Start()

        //FORGOT THIS :)            ModelBinders.Binders.Add(typeof(DataTablesPageRequest), new DataTablesModelBinder());


  • http://twitter.com/NaiNyshaH Hussnain Raza

    outstanding work

  • boofar

    hi, this is awesome. just wanted to tell you that i appreciate all the posts on petapoco.

Back to top
mobile desktop