private static void TestEntityFrameworkCore() { using (var context = new ProjectVContext()) { var tmdbMovie = new TmdbMovieInfo( thingId: 1, title: "Test", voteCount: 100, voteAverage: 10.0, overview: "Overview", releaseDate: DateTime.UtcNow, popularity: 50.0, adult: true, genreIds: new List <int> { 1, 2, 4 }, posterPath: "None" ); context.Add(tmdbMovie); int count = context.SaveChanges(); Console.WriteLine($"{count.ToString()} records saved to database."); } using (var context = new ProjectVContext()) { foreach (TmdbMovieInfo tmdbMovie in context.TmdbMovies) { Console.WriteLine( $"TMDB movie: {tmdbMovie.ThingId.ToString()}, {tmdbMovie.Title}, " + $"{tmdbMovie.Popularity.ToString()}" ); } } }
public PostRepository(ProjectVContext context) { _context = context; }
public AccountService(ProjectVContext context, ITokenService tokenService) { _context = context; _tokenService = tokenService; }
public UserRepository(ProjectVContext context) { _context = context; }