Exemplo n.º 1
0
        public async Task <MovieEntity> Add(MovieEntity newMovie)
        {
            _context.Movies.Add(newMovie);
            await _context.SaveChangesAsync();

            return(newMovie);
        }
Exemplo n.º 2
0
 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();
     });
 }