Is there any way we could do efficient paging with petapoco and mvc3. At present i am pulling all the records which is certainly not a prefect way to do it.
It was very easy with using LINQ skip() take().
NOTE: this is going to be implemented in an auction portal and database would be massive.
Experts please shed some light.
There's an example of how you could do paged queries in the documentation. And here's the new API.
Related
For an application which doesn't require any other OData capabilities, where paging is implemented with parameters on controller, will it be right to include OData to use the paging features of it. If I understood concept wrong please educate me.
VS2010 Pro + SqlServer Express.
Having been dropped into ASP.NET MVC 3 with no guidance but the web (2 books on order), I can't even get off the ground.
The MVC itself I get. Not a problem.
PHP, Ruby, and even ghastly WebForms firmly tucked into my toolbelt, with a long history of C++ QT client-server development before that.
Tying ASP.NET MVC 3 to a database using EF4 ORM is killing me.
The goals:
Use database modeled by DBA. I can specify all naming conventions, but code first is not an option!
Import to EDMX. This will be regularly updated using VS tools from the DBA's DB, never edited directly.
Generate partial classes from EDMX, for use as model. This will regularly be updated using VS tools, never edited directly.
Use 'buddy' to extend above model class with code as the Controllers/Views need.
Intuitively use the resulting model, pass it to the view, retrieve posts into it for insert/save, etc...
I've seen and read so many blogs, forum posts, walkthroughs, and stack overflow posts regarding this very use case.
I even tried riding the magic unicorn, followed by the latest 4.2beta1 with DbContext generators.
But can't get off the ground.
I follow instructions, but just not understanding how to do anything with it.
What conventions does the 'buddy' require (if any)? How do I use it? How do I get data with it? How do I write data?
Every example looks different. MVC guides are always focused on the UI side. EF guides don't cover usage in the MVC.
These are basic questions, and I'm feeling like the most incompetent idiot in the WWW right now.
Is anyone out there currently using MVC3 & EF4.x in the way I describe above?
This video is a good starting resource. Its a video of a guy creating an app from scratch that uses entity and a sql database (though he makes the db in the video, its still good for seeing some basics in action). You can see how he pulls data from the database, displays it on the page, and saves changes back to the database.
The first question I would ask is why are you stuck on using EF as an ORM or even insisting an ORM at all? I'd choose tools to suit the job here, especially given the constraints of the data layer.
Buddy classes were a concept invented in a day when the main .NET ORMs had no code-first option as ORM-encumbered class instances really don't behave well under things like model binding. Nevermind you could not decorate them with the DataAnnotations one used to indicate fields were required. Typically, the technical requirement is to use [MetadataType] attributes to tie your buddies to your models and perhaps something like AutoMapper to map data to and fro.
All that said, as a guy who has a few apps with lots of buddies and lots of automapping going on, you might want to think otherwise -- it is a bit of a maintenance nightmare. I'm living it.
There are some really good getting-started videos and tutorials right on ASP.NET MVC's site. The "Model (Data)" section is Entity Framework focused and touches on hot/trending topics like Repositories and Units Of Work.
I have looked at a number of examples (e.g. http://www.dotnetcurry.com/ShowArticle.aspx?ID=618 and http://msdn.microsoft.com/en-us/magazine/gg650669.aspx) but it seems very manual and convoluted.
The reason I would like to use the WebGrid is that there are no external dependancies, but I have very succesfully used jqGrid on another project.
Has anyone else succesfully managed to get server side paging working on the MVC3 Webgrid and would you recommend I use that rather than the jqGrid?
The MSDN article illustrates a perfect example of how to achieve server side paging. No matter which grid you use on the client, on the server that's a good way to paginate your data. As far as the WebGrid helper is concerned, I would recommend you MvcContrib.Grid or Telerik Grid if you are looking for a server side grid. If you are looking for a client side grid, jqGrid is really nice.
You might find some commercial components for which the server side code doesn't look convoluted to you but bear in mind that with such solutions you don't know how what is happening under the covers, even worse you might lose control, which usually ends up with late night calls from your db administrators telling you that your queries are just a horror.
i'm looking for implement datagrid with CI, better if using ajax.
Searching on Google i've found many tutorial and discussion on how to use Flexigrid-4-CI or jqGrid, anyway i'm still confused on which one could offer more flexibility.
For example, is it possible to set more than one field to filter results with Flexigrid? Besides extending my search i found other libraries such as CarboGrid or datagrid-CI.
Does anyone tried that stuff? What's your suggestion? CarboGrid looks really interesting...
I am using datatables, simple, clean, and fast under 1000 rows.
I have found a few actively on development
phpGrid - A lot of features
SmartGrid - Simple grid with bootstrap support
Grocery CRUD Datagrid - A framework with Datagrid
I have a MVC 2 web application that will have a high volume of users. One page in particular will be rendered based on XML from a database table. I was hoping to use de-serialization to parse the XML into an object tree for easier access to the data. However I'm not so sure that this will perform well enough for my users. Is there any other methods to parse the XML that will have better performance implications? I'm not that familiar with XSLT but is that a viable option?
Thanks in advance!!
We decided to go with the xslt transformation. Problem solved.