public ActionResult Index(UsersFilter filters) { var users = FilterUsers(filters); var model = new UsersList { Users = users, Filters = filters }; return(View(model)); }
public ActionResult Index(UsersFilter filters) { var users = FilterUsers(filters); var model = new UsersList { Users = users, Filters = filters }; return(Json(users, JsonRequestBehavior.AllowGet)); //return View(model); }
private IEnumerable <User> FilterUsers(UsersFilter filters) { IQueryable <User> users = Context.Users.AsQueryable() .OrderBy(r => r.Email); if (filters.Email != null && filters.Password != null) { users = users .Where(r => r.Email == filters.Email && r.Password == filters.Password); } //if (filters.Password != "") //{ // var query = Query<User>.LTE(r => r.Price, filters.PriceLimit); // users = users // .Where(r => query.Inject()); //} return(users); }