protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (_context != null) { _context.Dispose(); _context = null; } } }
public BookController() { _context = new NewLibraryDbContext(); _bookRepository = new EfRepository <Book>(_context); _bookService = new BookApplicationService(_bookRepository); }