public void Init() { Cleanup(); using (var dataContext = new GeekPeekedDbContext()) { dataContext.Genres.Add(ThrillerGenre); var m1 = new Movie() { Title = "Title 1", }; m1.Genres.Add(ThrillerGenre); var m2 = new Movie() { Title = "Title 2" }; m2.Genres.Add(ThrillerGenre); dataContext.Movies.Add(m1); dataContext.Movies.Add(m2); dataContext.SaveChanges(); } }
public AdminController() { _context = new GeekPeekedDbContext(); _movie = new Repository <Movie>(_context); _genre = new Repository <Genre>(_context); _image = new Repository <Image>(_context); _video = new Repository <Video>(_context); _credit = new Repository <Credit>(_context); _person = new Repository <Person>(_context); _keyword = new Repository <Keyword>(_context); _certification = new Repository <Certification>(_context); _productionCompany = new Repository <ProductionCompany>(_context); }
public void Cleanup() { using (var dataContext = new GeekPeekedDbContext()) { IQueryable <Movie> movies = dataContext.Movies.Select(m => m); IQueryable <Genre> genres = dataContext.Genres.Select(g => g); foreach (Genre genre in genres) { dataContext.Genres.Remove(genre); } foreach (Movie movie in movies) { dataContext.Movies.Remove(movie); } dataContext.SaveChanges(); } }
public AcademyAwardsContestRepository(GeekPeekedDbContext context) : base(context) { }
public ContestRepository(GeekPeekedDbContext context) : base(context) { }
public BaseRepository(GeekPeekedDbContext context) { _context = context; }
public Repository(GeekPeekedDbContext dataContext) { DbSet = dataContext.Set <T>(); }
public UserRepository(GeekPeekedDbContext context, ApplicationUserManager userManager) : base(context) { _userManager = userManager; }