public BookController(BookApiContext context) { _context = context; _context.Database.EnsureCreated(); if (_context.Book.Count() == 0) { Book book = new Book() { Title = "Some new cool book", Author = "George L. T. Bentes", Genre = "Cool" }; _context.Book.Add(book); _context.SaveChanges(); } }
public BooksController(BookApiContext context) { _context = context; }
public AutorRepository(BookApiContext context) { _context = context; }
public LivroRepository(BookApiContext context) { _context = context; }