diff --git a/backend/Controllers/MovieController.cs b/backend/Controllers/MovieController.cs index 2dc8e4e..32b77db 100644 --- a/backend/Controllers/MovieController.cs +++ b/backend/Controllers/MovieController.cs @@ -22,7 +22,14 @@ public class MovieController: ControllerBase try { var movies = _context.Movies.ToList(); - return Ok(movies); + + var totalMovies = movies.Count; + var totalPages = Math.Ceiling((double)totalMovies / pageSize); + + IEnumerable resultSkip = movies.Skip(pageSize * (pageNumber - 1)); + IEnumerable resultTake = resultSkip.Take(pageSize); + + return Ok(resultTake); } catch (Exception ex) {