public static IBookRepository <Book> GetInMemoryBookRepository(string dbName) { var options = new DbContextOptionsBuilder <BookContext>() .UseInMemoryDatabase(databaseName: dbName) .Options; BookContext bookContext = new BookContext(options); bookContext.FillDatabase(); return(new BookRepository(bookContext)); }