public async Task <IActionResult> BookCatalogDetails(int?id) { if (id == null || id == 0) { return(NotFound()); } //var bk = (from b in _context.Book where b.BookId == book.BookId select b.PhotoFileName).ToArray(); Book bookVisualized = (from b in _context.Book where b.BookId == id select b).SingleOrDefault(); bookVisualized.Visualizations++; _context.Book.Update(bookVisualized); await _context.SaveChangesAsync(); _context.SaveChanges(); var book = await _context.Book .Include(b => b.BookCondition) .Include(b => b.StudyArea) .Include(b => b.User) .FirstOrDefaultAsync(m => m.BookId == id); if (book == null) { return(NotFound()); } return(View(book)); }