using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Domain.Entities; using Domain.Repositories; namespace FilmsRUsOnline.Controllers { public class FilmsController : Controller { // The controller needs a films repository to access films. private IFilmsRepository filmsRepository; public int PageSize = 3; // Constructor receives a Repository via Dependency Injection. public FilmsController(IFilmsRepository filmsRepository) { this.filmsRepository = filmsRepository; } // Action method to list all films. public ViewResult List(int pageNumber = 1) { return View(filmsRepository.Films) } } }