mcintyre321 / mvc.jquery.datatables

ASP MVC Helpers for connecting IQueryables with the amazing DataTables.net plugin
https://aspdatatables.azurewebsites.net/
MIT License
186 stars 149 forks source link

IEnumerable<T> in addition to IQueryable<T> #152

Closed brunoshine closed 8 years ago

brunoshine commented 8 years ago

Hi,

when implementing some architecture patterns, like CQRS, one gets a already populated collection rather an iqueryable one, so the DataTablesResult.Create should allow for an IEnumerable (or related) with addition to the total records count.

As is, some methods of the DataTablesResult are private (i.e. ApplyOutputRules) so we cannot construct the result.

Thanks, Bruno

mcintyre321 commented 8 years ago

Can you use .AsQueryable() - I'm a bit concerned that letting people enter IEnumerable will result in a million github issues where people do a .ToArray() on their ORM then complain that their queries take a log time.

I'm happy to accept PRs which make the project more flexible.

brunoshine commented 8 years ago

Let me see what I can cook up. I'll do a PR later if I come up with some solution.

Thanks, Bruno