public async Task <MovieEntity> Add(MovieEntity newMovie) { _context.Movies.Add(newMovie); await _context.SaveChangesAsync(); return(newMovie); }
public async Task InsertSampleData() { await Task.Run(async() => { _context.Movies.Add(new MovieEntity { Title = "Star Wars", Director = "George Lucas" }); _context.Movies.Add(new MovieEntity { Title = "Empire Strikes Back", Director = "George Lucas" }); await _context.SaveChangesAsync(); }); }