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

            return(newMovie);
        }
Esempio 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();
     });
 }