Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class IndexModel : PageModel
- {
- public IList<Book> Books { get; private set; }
- private readonly LibraryContext _db;
- public IndexModel(LibraryContext db)
- {
- _db = db;
- }
- public void OnGet()
- {
- Books = _db.Books.AsNoTracking().ToList();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement