private async Task SeedAsync() { if (_db.Books.Any()) { return; } // add your code var books = new List <Book> { new Book { Title = "book1", Category = "music", TimePosted = DateTime.Now } }; _db.Books.AddRange(books); await _db.SaveChangesAsync(); }
public async Task <int> SaveChangesAsync() { return(await _db.SaveChangesAsync()); }