public GenreController() { string cnnString = ConfigurationManager.ConnectionStrings["defaultCnn"].ToString(); var dbContext = new CinemaDbContext(cnnString); var genreRepo = new GenreRepository(dbContext); _genreService = new GenreService(genreRepo); }
public BaseController() { string cnnString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString(); var dbContext = new CinemaDbContext(cnnString); var actorsRepo = new ActorRepository(dbContext); _actorService = new ActorService(actorsRepo); var genreRepo = new GenreRepository(dbContext); _genreService = new GenreService(genreRepo); var hallRepo = new HallRepository(dbContext); _hallService = new HallService(hallRepo); var movieRepo = new MovieRepository(dbContext); _movieService = new MovieService(movieRepo, actorsRepo); }