Closed rexdefuror closed 12 years ago
This project relies upon my PagedList project (https://github.com/TroyGoode/PagedList), and expects the Users property to implement IPagedList
string[] roles = Roles.GetRolesForUser();
return View(new UserTableVM
{
Users = _userService
.Where(
x => _rolesService.GetRolesForUser(x.UserName).SequenceEqual(roles)
).ToPagedList(index ?? 0, PageSize), // <-- CONVERT TO IPAGEDLIST<T>
Roles = roles
});
I'm still in process of getting full grasp on MVC Membership and this starter kit helped a lot. Now I have an issue which I could not solve on my own.
My user table viewmodel:
And when I try to filter users by role it won't work because I get
IEnumerable
instead ofIPagedList
, I've tried casting it and get bunch of errors, also I've tried changing the type in viewmodel toIEnumerable
instead ofIPagedList
and still it errors out.This is the code I've tried.
Please help.