public IActionResult Results(int threshold, int skip = 0, int take = 0) { return(_stopwatch.Run(() => { var query = _posts.List(threshold, skip, take); return Json(query); })); }
public IActionResult Results(int threshold, int skip = 0, int take = 0) { return(_stopwatch.Run(() => { var query = _db.Posts.Where(post => post.PostId > threshold); if (skip > 0) { query = query.Skip(skip); } if (take > 0) { query = query.Take(take); } return Json(query.ToList()); })); }