This project has moved. For the latest updates, please go here.

Filtering the Ticket List in TicketCenterListViewModel

Mar 28, 2014 at 3:39 PM
I am trying to filter the "ticketsList" variable in the view model. Maybe not the appropriate place, however, I have run into issues where using code like the following:

ticketsList.Where(x=>x.Type == "some type").AsPagination(ticketsList.PageNumber, ticketsList.PageSize);

also tried

var list = new LazyPagination<Ticket>(ticketsList.Where(x => x.Type == "some type").AsQueryable<Ticket>(), ticketsList.PageNumber, ticketsList.PageSize);

I just want to filter the results, but it seems that I am missing something crucial here because it completely hoses the paginating (only displays a fraction of what it should, page number links aren't working, etc.).

Any ideas?
Mar 28, 2014 at 3:48 PM
Edited Mar 28, 2014 at 3:51 PM
Ok, so a thought just occurred to me. The ticketsList is a list of pages of Tickets, right? So my query is probably just filtering the first page and that is it. Am i correct?

EDIT: Nope, thats not it.
Mar 28, 2014 at 6:54 PM
Well, once again i have solved my own issue with much beating of my head against a wall. The solution (if anyone is interested) that I came up with was to create a new method in the TicketRepository called ListTicketsFor. This method is exactly the same as ListTickets, but it takes the listName as an additional parameter. i pre-filter the list according to my needs based on which list is getting retrieved.